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