xref: /linux/Documentation/arch/arc/arc.rst (revision 1ac731c529cd4d6adbce134754b51ff7d822b145)
1*fde2e40fSJonathan Corbet.. SPDX-License-Identifier: GPL-2.0
2*fde2e40fSJonathan Corbet
3*fde2e40fSJonathan CorbetLinux kernel for ARC processors
4*fde2e40fSJonathan Corbet*******************************
5*fde2e40fSJonathan Corbet
6*fde2e40fSJonathan CorbetOther sources of information
7*fde2e40fSJonathan Corbet############################
8*fde2e40fSJonathan Corbet
9*fde2e40fSJonathan CorbetBelow are some resources where more information can be found on
10*fde2e40fSJonathan CorbetARC processors and relevant open source projects.
11*fde2e40fSJonathan Corbet
12*fde2e40fSJonathan Corbet- `<https://embarc.org>`_ - Community portal for open source on ARC.
13*fde2e40fSJonathan Corbet  Good place to start to find relevant FOSS projects, toolchain releases,
14*fde2e40fSJonathan Corbet  news items and more.
15*fde2e40fSJonathan Corbet
16*fde2e40fSJonathan Corbet- `<https://github.com/foss-for-synopsys-dwc-arc-processors>`_ -
17*fde2e40fSJonathan Corbet  Home for all development activities regarding open source projects for
18*fde2e40fSJonathan Corbet  ARC processors. Some of the projects are forks of various upstream projects,
19*fde2e40fSJonathan Corbet  where "work in progress" is hosted prior to submission to upstream projects.
20*fde2e40fSJonathan Corbet  Other projects are developed by Synopsys and made available to community
21*fde2e40fSJonathan Corbet  as open source for use on ARC Processors.
22*fde2e40fSJonathan Corbet
23*fde2e40fSJonathan Corbet- `Official Synopsys ARC Processors website
24*fde2e40fSJonathan Corbet  <https://www.synopsys.com/designware-ip/processor-solutions.html>`_ -
25*fde2e40fSJonathan Corbet  location, with access to some IP documentation (`Programmer's Reference
26*fde2e40fSJonathan Corbet  Manual, AKA PRM for ARC HS processors
27*fde2e40fSJonathan Corbet  <https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf>`_)
28*fde2e40fSJonathan Corbet  and free versions of some commercial tools (`Free nSIM
29*fde2e40fSJonathan Corbet  <https://www.synopsys.com/cgi-bin/dwarcnsim/req1.cgi>`_ and
30*fde2e40fSJonathan Corbet  `MetaWare Light Edition <https://www.synopsys.com/cgi-bin/arcmwtk_lite/reg1.cgi>`_).
31*fde2e40fSJonathan Corbet  Please note though, registration is required to access both the documentation and
32*fde2e40fSJonathan Corbet  the tools.
33*fde2e40fSJonathan Corbet
34*fde2e40fSJonathan CorbetImportant note on ARC processors configurability
35*fde2e40fSJonathan Corbet################################################
36*fde2e40fSJonathan Corbet
37*fde2e40fSJonathan CorbetARC processors are highly configurable and several configurable options
38*fde2e40fSJonathan Corbetare supported in Linux. Some options are transparent to software
39*fde2e40fSJonathan Corbet(i.e cache geometries, some can be detected at runtime and configured
40*fde2e40fSJonathan Corbetand used accordingly, while some need to be explicitly selected or configured
41*fde2e40fSJonathan Corbetin the kernel's configuration utility (AKA "make menuconfig").
42*fde2e40fSJonathan Corbet
43*fde2e40fSJonathan CorbetHowever not all configurable options are supported when an ARC processor
44*fde2e40fSJonathan Corbetis to run Linux. SoC design teams should refer to "Appendix E:
45*fde2e40fSJonathan CorbetConfiguration for ARC Linux" in the ARC HS Databook for configurability
46*fde2e40fSJonathan Corbetguidelines.
47*fde2e40fSJonathan Corbet
48*fde2e40fSJonathan CorbetFollowing these guidelines and selecting valid configuration options
49*fde2e40fSJonathan Corbetup front is critical to help prevent any unwanted issues during
50*fde2e40fSJonathan CorbetSoC bringup and software development in general.
51*fde2e40fSJonathan Corbet
52*fde2e40fSJonathan CorbetBuilding the Linux kernel for ARC processors
53*fde2e40fSJonathan Corbet############################################
54*fde2e40fSJonathan Corbet
55*fde2e40fSJonathan CorbetThe process of kernel building for ARC processors is the same as for any other
56*fde2e40fSJonathan Corbetarchitecture and could be done in 2 ways:
57*fde2e40fSJonathan Corbet
58*fde2e40fSJonathan Corbet- Cross-compilation: process of compiling for ARC targets on a development
59*fde2e40fSJonathan Corbet  host with a different processor architecture (generally x86_64/amd64).
60*fde2e40fSJonathan Corbet- Native compilation: process of compiling for ARC on a ARC platform
61*fde2e40fSJonathan Corbet  (hardware board or a simulator like QEMU) with complete development environment
62*fde2e40fSJonathan Corbet  (GNU toolchain, dtc, make etc) installed on the platform.
63*fde2e40fSJonathan Corbet
64*fde2e40fSJonathan CorbetIn both cases, up-to-date GNU toolchain for ARC for the host is needed.
65*fde2e40fSJonathan CorbetSynopsys offers prebuilt toolchain releases which can be used for this purpose,
66*fde2e40fSJonathan Corbetavailable from:
67*fde2e40fSJonathan Corbet
68*fde2e40fSJonathan Corbet- Synopsys GNU toolchain releases:
69*fde2e40fSJonathan Corbet  `<https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases>`_
70*fde2e40fSJonathan Corbet
71*fde2e40fSJonathan Corbet- Linux kernel compilers collection:
72*fde2e40fSJonathan Corbet  `<https://mirrors.edge.kernel.org/pub/tools/crosstool>`_
73*fde2e40fSJonathan Corbet
74*fde2e40fSJonathan Corbet- Bootlin's toolchain collection: `<https://toolchains.bootlin.com>`_
75*fde2e40fSJonathan Corbet
76*fde2e40fSJonathan CorbetOnce the toolchain is installed in the system, make sure its "bin" folder
77*fde2e40fSJonathan Corbetis added in your ``PATH`` environment variable. Then set ``ARCH=arc`` &
78*fde2e40fSJonathan Corbet``CROSS_COMPILE=arc-linux`` (or whatever matches installed ARC toolchain prefix)
79*fde2e40fSJonathan Corbetand then as usual ``make defconfig && make``.
80*fde2e40fSJonathan Corbet
81*fde2e40fSJonathan CorbetThis will produce "vmlinux" file in the root of the kernel source tree
82*fde2e40fSJonathan Corbetusable for loading on the target system via JTAG.
83*fde2e40fSJonathan CorbetIf you need to get an image usable with U-Boot bootloader,
84*fde2e40fSJonathan Corbettype ``make uImage`` and ``uImage`` will be produced in ``arch/arc/boot``
85*fde2e40fSJonathan Corbetfolder.
86