Merge tag 'drm-next-2022-01-21' of git://anongit.freedesktop.org/drm/drm
[linux-2.6-microblaze.git] / Documentation / arc / arc.rst
1 .. SPDX-License-Identifier: GPL-2.0
2
3 Linux kernel for ARC processors
4 *******************************
5
6 Other sources of information
7 ############################
8
9 Below are some resources where more information can be found on
10 ARC 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
34 Important note on ARC processors configurability
35 ################################################
36
37 ARC processors are highly configurable and several configurable options
38 are supported in Linux. Some options are transparent to software
39 (i.e cache geometries, some can be detected at runtime and configured
40 and used accordingly, while some need to be explicitly selected or configured
41 in the kernel's configuration utility (AKA "make menuconfig").
42
43 However not all configurable options are supported when an ARC processor
44 is to run Linux. SoC design teams should refer to "Appendix E:
45 Configuration for ARC Linux" in the ARC HS Databook for configurability
46 guidelines.
47
48 Following these guidelines and selecting valid configuration options
49 up front is critical to help prevent any unwanted issues during
50 SoC bringup and software development in general.
51
52 Building the Linux kernel for ARC processors
53 ############################################
54
55 The process of kernel building for ARC processors is the same as for any other
56 architecture 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
64 In both cases, up-to-date GNU toolchain for ARC for the host is needed.
65 Synopsys offers prebuilt toolchain releases which can be used for this purpose,
66 available 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
76 Once the toolchain is installed in the system, make sure its "bin" folder
77 is added in your ``PATH`` environment variable. Then set ``ARCH=arc`` &
78 ``CROSS_COMPILE=arc-linux`` (or whatever matches installed ARC toolchain prefix)
79 and then as usual ``make defconfig && make``.
80
81 This will produce "vmlinux" file in the root of the kernel source tree
82 usable for loading on the target system via JTAG.
83 If you need to get an image usable with U-Boot bootloader,
84 type ``make uImage`` and ``uImage`` will be produced in ``arch/arc/boot``
85 folder.