162306a36Sopenharmony_ci.. SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci 362306a36Sopenharmony_ciLinux kernel for ARC processors 462306a36Sopenharmony_ci******************************* 562306a36Sopenharmony_ci 662306a36Sopenharmony_ciOther sources of information 762306a36Sopenharmony_ci############################ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ciBelow are some resources where more information can be found on 1062306a36Sopenharmony_ciARC processors and relevant open source projects. 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci- `<https://embarc.org>`_ - Community portal for open source on ARC. 1362306a36Sopenharmony_ci Good place to start to find relevant FOSS projects, toolchain releases, 1462306a36Sopenharmony_ci news items and more. 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci- `<https://github.com/foss-for-synopsys-dwc-arc-processors>`_ - 1762306a36Sopenharmony_ci Home for all development activities regarding open source projects for 1862306a36Sopenharmony_ci ARC processors. Some of the projects are forks of various upstream projects, 1962306a36Sopenharmony_ci where "work in progress" is hosted prior to submission to upstream projects. 2062306a36Sopenharmony_ci Other projects are developed by Synopsys and made available to community 2162306a36Sopenharmony_ci as open source for use on ARC Processors. 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci- `Official Synopsys ARC Processors website 2462306a36Sopenharmony_ci <https://www.synopsys.com/designware-ip/processor-solutions.html>`_ - 2562306a36Sopenharmony_ci location, with access to some IP documentation (`Programmer's Reference 2662306a36Sopenharmony_ci Manual, AKA PRM for ARC HS processors 2762306a36Sopenharmony_ci <https://www.synopsys.com/dw/doc.php/ds/cc/programmers-reference-manual-ARC-HS.pdf>`_) 2862306a36Sopenharmony_ci and free versions of some commercial tools (`Free nSIM 2962306a36Sopenharmony_ci <https://www.synopsys.com/cgi-bin/dwarcnsim/req1.cgi>`_ and 3062306a36Sopenharmony_ci `MetaWare Light Edition <https://www.synopsys.com/cgi-bin/arcmwtk_lite/reg1.cgi>`_). 3162306a36Sopenharmony_ci Please note though, registration is required to access both the documentation and 3262306a36Sopenharmony_ci the tools. 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ciImportant note on ARC processors configurability 3562306a36Sopenharmony_ci################################################ 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ciARC processors are highly configurable and several configurable options 3862306a36Sopenharmony_ciare supported in Linux. Some options are transparent to software 3962306a36Sopenharmony_ci(i.e cache geometries, some can be detected at runtime and configured 4062306a36Sopenharmony_ciand used accordingly, while some need to be explicitly selected or configured 4162306a36Sopenharmony_ciin the kernel's configuration utility (AKA "make menuconfig"). 4262306a36Sopenharmony_ci 4362306a36Sopenharmony_ciHowever not all configurable options are supported when an ARC processor 4462306a36Sopenharmony_ciis to run Linux. SoC design teams should refer to "Appendix E: 4562306a36Sopenharmony_ciConfiguration for ARC Linux" in the ARC HS Databook for configurability 4662306a36Sopenharmony_ciguidelines. 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ciFollowing these guidelines and selecting valid configuration options 4962306a36Sopenharmony_ciup front is critical to help prevent any unwanted issues during 5062306a36Sopenharmony_ciSoC bringup and software development in general. 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ciBuilding the Linux kernel for ARC processors 5362306a36Sopenharmony_ci############################################ 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ciThe process of kernel building for ARC processors is the same as for any other 5662306a36Sopenharmony_ciarchitecture and could be done in 2 ways: 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci- Cross-compilation: process of compiling for ARC targets on a development 5962306a36Sopenharmony_ci host with a different processor architecture (generally x86_64/amd64). 6062306a36Sopenharmony_ci- Native compilation: process of compiling for ARC on a ARC platform 6162306a36Sopenharmony_ci (hardware board or a simulator like QEMU) with complete development environment 6262306a36Sopenharmony_ci (GNU toolchain, dtc, make etc) installed on the platform. 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ciIn both cases, up-to-date GNU toolchain for ARC for the host is needed. 6562306a36Sopenharmony_ciSynopsys offers prebuilt toolchain releases which can be used for this purpose, 6662306a36Sopenharmony_ciavailable from: 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ci- Synopsys GNU toolchain releases: 6962306a36Sopenharmony_ci `<https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases>`_ 7062306a36Sopenharmony_ci 7162306a36Sopenharmony_ci- Linux kernel compilers collection: 7262306a36Sopenharmony_ci `<https://mirrors.edge.kernel.org/pub/tools/crosstool>`_ 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_ci- Bootlin's toolchain collection: `<https://toolchains.bootlin.com>`_ 7562306a36Sopenharmony_ci 7662306a36Sopenharmony_ciOnce the toolchain is installed in the system, make sure its "bin" folder 7762306a36Sopenharmony_ciis added in your ``PATH`` environment variable. Then set ``ARCH=arc`` & 7862306a36Sopenharmony_ci``CROSS_COMPILE=arc-linux`` (or whatever matches installed ARC toolchain prefix) 7962306a36Sopenharmony_ciand then as usual ``make defconfig && make``. 8062306a36Sopenharmony_ci 8162306a36Sopenharmony_ciThis will produce "vmlinux" file in the root of the kernel source tree 8262306a36Sopenharmony_ciusable for loading on the target system via JTAG. 8362306a36Sopenharmony_ciIf you need to get an image usable with U-Boot bootloader, 8462306a36Sopenharmony_citype ``make uImage`` and ``uImage`` will be produced in ``arch/arc/boot`` 8562306a36Sopenharmony_cifolder. 86