blob: 657ac4af7be6ab3bb8730885d2758affc184cbb0 [file] [log] [blame]
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -03001==============
Jonas Bonn61625762011-06-04 22:45:16 +03002OpenRISC Linux
3==============
4
5This is a port of Linux to the OpenRISC class of microprocessors; the initial
6target architecture, specifically, is the 32-bit OpenRISC 1000 family (or1k).
7
8For information about OpenRISC processors and ongoing development:
9
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030010 ======= =============================
Alexander A. Klimovf33d4072020-07-10 08:20:19 +020011 website https://openrisc.io
Stafford Hornee4082de2017-10-21 22:39:09 +090012 email openrisc@lists.librecores.org
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030013 ======= =============================
Jonas Bonn61625762011-06-04 22:45:16 +030014
15---------------------------------------------------------------------
16
17Build instructions for OpenRISC toolchain and Linux
18===================================================
19
20In order to build and run Linux for OpenRISC, you'll need at least a basic
21toolchain and, perhaps, the architectural simulator. Steps to get these bits
22in place are outlined here.
23
Stafford Hornee4082de2017-10-21 22:39:09 +0900241) Toolchain
Jonas Bonn61625762011-06-04 22:45:16 +030025
Stafford Hornee4082de2017-10-21 22:39:09 +090026Toolchain binaries can be obtained from openrisc.io or our github releases page.
27Instructions for building the different toolchains can be found on openrisc.io
28or Stafford's toolchain build and release scripts.
Jonas Bonn61625762011-06-04 22:45:16 +030029
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030030 ========== =================================================
Stafford Hornee4082de2017-10-21 22:39:09 +090031 binaries https://github.com/openrisc/or1k-gcc/releases
32 toolchains https://openrisc.io/software
33 building https://github.com/stffrdhrn/or1k-toolchain-build
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030034 ========== =================================================
Jonas Bonn61625762011-06-04 22:45:16 +030035
Stafford Hornee4082de2017-10-21 22:39:09 +0900362) Building
Jonas Bonn61625762011-06-04 22:45:16 +030037
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030038Build the Linux kernel as usual::
Jonas Bonn61625762011-06-04 22:45:16 +030039
Krzysztof Kozlowskia6c57292020-01-31 09:28:33 +010040 make ARCH=openrisc CROSS_COMPILE="or1k-linux-" defconfig
41 make ARCH=openrisc CROSS_COMPILE="or1k-linux-"
Jonas Bonn61625762011-06-04 22:45:16 +030042
Stafford Hornee4082de2017-10-21 22:39:09 +0900433) Running on FPGA (optional)
Jonas Bonn61625762011-06-04 22:45:16 +030044
Stafford Hornee4082de2017-10-21 22:39:09 +090045The OpenRISC community typically uses FuseSoC to manage building and programming
46an SoC into an FPGA. The below is an example of programming a De0 Nano
47development board with the OpenRISC SoC. During the build FPGA RTL is code
48downloaded from the FuseSoC IP cores repository and built using the FPGA vendor
49tools. Binaries are loaded onto the board with openocd.
Jonas Bonn61625762011-06-04 22:45:16 +030050
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030051::
52
Stafford Hornee4082de2017-10-21 22:39:09 +090053 git clone https://github.com/olofk/fusesoc
54 cd fusesoc
55 sudo pip install -e .
56
57 fusesoc init
58 fusesoc build de0_nano
59 fusesoc pgm de0_nano
60
61 openocd -f interface/altera-usb-blaster.cfg \
62 -f board/or1k_generic.cfg
63
64 telnet localhost 4444
65 > init
66 > halt; load_image vmlinux ; reset
67
684) Running on a Simulator (optional)
69
70QEMU is a processor emulator which we recommend for simulating the OpenRISC
71platform. Please follow the OpenRISC instructions on the QEMU website to get
72Linux running on QEMU. You can build QEMU yourself, but your Linux distribution
73likely provides binary packages to support OpenRISC.
74
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030075 ============= ======================================================
Stafford Hornee4082de2017-10-21 22:39:09 +090076 qemu openrisc https://wiki.qemu.org/Documentation/Platforms/OpenRISC
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030077 ============= ======================================================
Jonas Bonn61625762011-06-04 22:45:16 +030078
79---------------------------------------------------------------------
80
81Terminology
82===========
83
84In the code, the following particles are used on symbols to limit the scope
85to more or less specific processor implementations:
86
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030087========= =======================================
Jonas Bonn61625762011-06-04 22:45:16 +030088openrisc: the OpenRISC class of processors
89or1k: the OpenRISC 1000 family of processors
90or1200: the OpenRISC 1200 processor
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030091========= =======================================
Jonas Bonn61625762011-06-04 22:45:16 +030092
93---------------------------------------------------------------------
94
95History
96========
97
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -03009818-11-2003 Matjaz Breskvar (phoenix@bsemi.com)
Jonas Bonn61625762011-06-04 22:45:16 +030099 initial port of linux to OpenRISC/or32 architecture.
100 all the core stuff is implemented and seams usable.
101
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030010208-12-2003 Matjaz Breskvar (phoenix@bsemi.com)
Jonas Bonn61625762011-06-04 22:45:16 +0300103 complete change of TLB miss handling.
104 rewrite of exceptions handling.
105 fully functional sash-3.6 in default initrd.
106 a much improved version with changes all around.
107
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030010810-04-2004 Matjaz Breskvar (phoenix@bsemi.com)
Jonas Bonn61625762011-06-04 22:45:16 +0300109 alot of bugfixes all over.
110 ethernet support, functional http and telnet servers.
111 running many standard linux apps.
112
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030011326-06-2004 Matjaz Breskvar (phoenix@bsemi.com)
Jonas Bonn61625762011-06-04 22:45:16 +0300114 port to 2.6.x
115
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030011630-11-2004 Matjaz Breskvar (phoenix@bsemi.com)
Jonas Bonn61625762011-06-04 22:45:16 +0300117 lots of bugfixes and enhancments.
118 added opencores framebuffer driver.
119
Mauro Carvalho Chehab32fc3cd2019-07-26 09:51:24 -030012009-10-2010 Jonas Bonn (jonas@southpole.se)
Jonas Bonn61625762011-06-04 22:45:16 +0300121 major rewrite to bring up to par with upstream Linux 2.6.36