blob: 33e03dc8613fdbeb454d75ccb436112021898e35 [file] [log] [blame]
Atish Patra75a90392019-02-25 08:15:27 +00001FU540-C000 RISC-V SoC
2=====================
3The FU540-C000 is the worlds first 4+1 64-bit RISCV SoC from SiFive.
4
5The HiFive Unleashed development platform is based on FU540-C000 and capable
6of running Linux.
7
8Mainline support
9================
10The support for following drivers are already enabled:
111. SiFive UART Driver.
122. SiFive PRCI Driver for clock.
133. Cadence MACB ethernet driver for networking support.
14
15TODO:
Anup Patel12b480a2019-06-25 06:31:52 +0000161. SPI host driver is still missing.
172. SPI MMC driver does not compile and needs a re-write using U-Boot DM.
Atish Patra75a90392019-02-25 08:15:27 +0000182. U-Boot expects the serial console device entry to be present under /chosen
19 DT node. Example:
20 chosen {
21 stdout-path = "/soc/serial@10010000:115200";
22 };
23
24 Without a serial console U-Boot will panic.
25
26Building
27========
281. Add the RISC-V toolchain to your PATH.
292. Setup ARCH & cross compilation enviornment variable.
30 a. export ARCH=riscv
31 b. export CROSS_COMPILE=<riscv64 toolchain prefix>
323. make sifive_fu540_defconfig
334. make
34
35Flashing
36========
Anup Patel12b480a2019-06-25 06:31:52 +000037The current U-Boot port is supported in S-mode only and loaded directly
38into DRAM.
Atish Patra75a90392019-02-25 08:15:27 +000039
Anup Patel12b480a2019-06-25 06:31:52 +000040A prior stage (M-mode) firmware/bootloader (e.g OpenSBI) is required to
41boot the u-boot.bin in S-mode and provide M-mode runtime services.
Atish Patra75a90392019-02-25 08:15:27 +000042
Anup Patel12b480a2019-06-25 06:31:52 +000043Currently, the u-boot.bin is used as a payload of the OpenSBI FW_PAYLOAD
44firmware. We need to compile OpenSBI with below command:
45make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=<path to u-boot.bin> FW_PAYLOAD_FDT_PATH=<path to hifive-unleashed-a00.dtb from Linux>
46(Note: Prefer hifive-unleashed-a00.dtb from Linux-5.3 or higher)
47(Note: Linux-5.2 is also fine but it does not have ethernet DT node)
48
49More detailed description of steps required to build FW_PAYLOAD firmware
50is beyond the scope of this document. Please refer OpenSBI documenation.
Atish Patra75a90392019-02-25 08:15:27 +000051(Note: OpenSBI git repo is at https://github.com/riscv/opensbi.git)
Atish Patra75a90392019-02-25 08:15:27 +000052
53Once the prior stage firmware/bootloader binary is generated, it should be
54copied to the first partition of the sdcard.
55
56sudo dd if=<prior_stage_firmware_binary> of=/dev/disk2s1 bs=1024
57
58Booting
59=======
60Once you plugin the sdcard and power up, you should see the U-Boot prompt.
61
62Sample boot log from HiFive Unleashed board
63===========================================
Anup Patel12b480a2019-06-25 06:31:52 +000064U-Boot 2019.07-rc4-00013-g1837f893b0 (Jun 20 2019 - 11:08:48 +0530)
Atish Patra75a90392019-02-25 08:15:27 +000065
66CPU: rv64imafdc
Anup Patel12b480a2019-06-25 06:31:52 +000067Model: SiFive HiFive Unleashed A00
Atish Patra75a90392019-02-25 08:15:27 +000068DRAM: 8 GiB
69In: serial@10010000
70Out: serial@10010000
71Err: serial@10010000
Anup Patel12b480a2019-06-25 06:31:52 +000072Net: eth0: ethernet@10090000
Atish Patra75a90392019-02-25 08:15:27 +000073Hit any key to stop autoboot: 0
74=> version
Anup Patel12b480a2019-06-25 06:31:52 +000075U-Boot 2019.07-rc4-00013-g1837f893b0 (Jun 20 2019 - 11:08:48 +0530)
Atish Patra75a90392019-02-25 08:15:27 +000076
77riscv64-linux-gcc.br_real (Buildroot 2018.11-rc2-00003-ga0787e9) 8.2.0
78GNU ld (GNU Binutils) 2.31.1
79=>
80===============================================================================
81
82Now you can configure your networking, tftp server and use tftp boot method to
83load uImage.
84
85==========================================================================
Anup Patel12b480a2019-06-25 06:31:52 +000086=> setenv ipaddr 10.206.5.241
Atish Patra75a90392019-02-25 08:15:27 +000087=> setenv netmask 255.255.252.0
Anup Patel12b480a2019-06-25 06:31:52 +000088=> setenv serverip 10.206.4.143
89=> setenv gateway 10.206.4.1
90=> tftpboot ${kernel_addr_r} /sifive/fu540/uImage
Atish Patra75a90392019-02-25 08:15:27 +000091ethernet@10090000: PHY present at 0
92ethernet@10090000: Starting autonegotiation...
93ethernet@10090000: Autonegotiation complete
Anup Patel12b480a2019-06-25 06:31:52 +000094ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x7c00)
Atish Patra75a90392019-02-25 08:15:27 +000095Using ethernet@10090000 device
Anup Patel12b480a2019-06-25 06:31:52 +000096TFTP from server 10.206.4.143; our IP address is 10.206.5.241
97Filename '/sifive/fu540/uImage'.
98Load address: 0x80600000
Atish Patra75a90392019-02-25 08:15:27 +000099Loading: #################################################################
100 #################################################################
101 #################################################################
102 #################################################################
103 #################################################################
104 #################################################################
105 #################################################################
106 #################################################################
107 #################################################################
Anup Patel12b480a2019-06-25 06:31:52 +0000108 ########################################
109 1.5 MiB/s
110done
111Bytes transferred = 9162364 (8bce7c hex)
112=> tftpboot ${ramdisk_addr_r} /sifive/fu540/uRamdisk
113ethernet@10090000: PHY present at 0
114ethernet@10090000: Starting autonegotiation...
115ethernet@10090000: Autonegotiation complete
116ethernet@10090000: link up, 1000Mbps full-duplex (lpa: 0x7c00)
117Using ethernet@10090000 device
118TFTP from server 10.206.4.143; our IP address is 10.206.5.241
119Filename '/sifive/fu540/uRamdisk'.
120Load address: 0x82500000
121Loading: #################################################################
Atish Patra75a90392019-02-25 08:15:27 +0000122 #################################################################
Anup Patel12b480a2019-06-25 06:31:52 +0000123 ##################################
124 448.2 KiB/s
Atish Patra75a90392019-02-25 08:15:27 +0000125done
Anup Patel12b480a2019-06-25 06:31:52 +0000126Bytes transferred = 2398272 (249840 hex)
127=> setenv bootargs "root=/dev/ram rw console=ttySIF0 earlycon=sbi"
128=> bootm ${kernel_addr_r} ${ramdisk_addr_r} ${fdtcontroladdr}
129## Booting kernel from Legacy Image at 80600000 ...
Atish Patra75a90392019-02-25 08:15:27 +0000130 Image Name: Linux
131 Image Type: RISC-V Linux Kernel Image (uncompressed)
Anup Patel12b480a2019-06-25 06:31:52 +0000132 Data Size: 9162300 Bytes = 8.7 MiB
Atish Patra75a90392019-02-25 08:15:27 +0000133 Load Address: 80200000
134 Entry Point: 80200000
135 Verifying Checksum ... OK
Anup Patel12b480a2019-06-25 06:31:52 +0000136## Loading init Ramdisk from Legacy Image at 82500000 ...
137 Image Name: Linux RootFS
138 Image Type: RISC-V Linux RAMDisk Image (uncompressed)
139 Data Size: 2398208 Bytes = 2.3 MiB
140 Load Address: 00000000
141 Entry Point: 00000000
142 Verifying Checksum ... OK
143## Flattened Device Tree blob at ff795730
144 Booting using the fdt blob at 0xff795730
Atish Patra75a90392019-02-25 08:15:27 +0000145 Loading Kernel Image ... OK
Anup Patel12b480a2019-06-25 06:31:52 +0000146 Using Device Tree in place at 00000000ff795730, end 00000000ff799dac
Atish Patra75a90392019-02-25 08:15:27 +0000147
148Starting kernel ...
149
150[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
Anup Patel12b480a2019-06-25 06:31:52 +0000151[ 0.000000] Linux version 5.2.0-rc1-00003-gb9543e66e700 (anup@anup-lab-machine) (gcc version 8.2.0 (Buildroot 2018.11-rc2-00003-ga0787e9)) #1 SMP Thu Jun 20 11:41:26 IST 2019
152[ 0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
153[ 0.000000] printk: bootconsole [sbi0] enabled
154[ 0.000000] Initial ramdisk at: 0x(____ptrval____) (2398208 bytes)
Atish Patra75a90392019-02-25 08:15:27 +0000155[ 0.000000] Zone ranges:
156[ 0.000000] DMA32 [mem 0x0000000080200000-0x00000000ffffffff]
Anup Patel12b480a2019-06-25 06:31:52 +0000157[ 0.000000] Normal [mem 0x0000000100000000-0x000000027fffffff]
Atish Patra75a90392019-02-25 08:15:27 +0000158[ 0.000000] Movable zone start for each node
159[ 0.000000] Early memory node ranges
160[ 0.000000] node 0: [mem 0x0000000080200000-0x000000027fffffff]
161[ 0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x000000027fffffff]
Anup Patel12b480a2019-06-25 06:31:52 +0000162[ 0.000000] software IO TLB: mapped [mem 0xfb795000-0xff795000] (64MB)
163[ 0.000000] CPU with hartid=0 is not available
164[ 0.000000] CPU with hartid=0 is not available
Atish Patra75a90392019-02-25 08:15:27 +0000165[ 0.000000] elf_hwcap is 0x112d
Anup Patel12b480a2019-06-25 06:31:52 +0000166[ 0.000000] percpu: Embedded 17 pages/cpu s29592 r8192 d31848 u69632
Atish Patra75a90392019-02-25 08:15:27 +0000167[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 2067975
Anup Patel12b480a2019-06-25 06:31:52 +0000168[ 0.000000] Kernel command line: root=/dev/ram rw console=ttySIF0 earlycon=sbi
Atish Patra75a90392019-02-25 08:15:27 +0000169[ 0.000000] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes)
170[ 0.000000] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes)
171[ 0.000000] Sorting __ex_table...
Anup Patel12b480a2019-06-25 06:31:52 +0000172[ 0.000000] Memory: 8182056K/8386560K available (5753K kernel code, 357K rwdata, 1804K rodata, 204K init, 808K bss, 204504K reserved, 0K cma-reserved)
Atish Patra75a90392019-02-25 08:15:27 +0000173[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
174[ 0.000000] rcu: Hierarchical RCU implementation.
Atish Patra75a90392019-02-25 08:15:27 +0000175[ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
Anup Patel12b480a2019-06-25 06:31:52 +0000176[ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
Atish Patra75a90392019-02-25 08:15:27 +0000177[ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
178[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
Anup Patel12b480a2019-06-25 06:31:52 +0000179[ 0.000000] plic: mapped 53 interrupts with 4 handlers for 9 contexts.
180[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [2]
Atish Patra75a90392019-02-25 08:15:27 +0000181[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1d854df40, max_idle_ns: 3526361616960 ns
Anup Patel12b480a2019-06-25 06:31:52 +0000182[ 0.000007] sched_clock: 64 bits at 1000kHz, resolution 1000ns, wraps every 2199023255500ns
183[ 0.008553] Console: colour dummy device 80x25
184[ 0.012990] Calibrating delay loop (skipped), value calculated using timer frequency.. 2.00 BogoMIPS (lpj=4000)
185[ 0.023103] pid_max: default: 32768 minimum: 301
186[ 0.028269] Mount-cache hash table entries: 16384 (order: 5, 131072 bytes)
187[ 0.035068] Mountpoint-cache hash table entries: 16384 (order: 5, 131072 bytes)
188[ 0.042770] *** VALIDATE proc ***
189[ 0.045610] *** VALIDATE cgroup1 ***
190[ 0.049157] *** VALIDATE cgroup2 ***
191[ 0.053743] rcu: Hierarchical SRCU implementation.
192[ 0.058297] smp: Bringing up secondary CPUs ...
193[ 0.064134] smp: Brought up 1 node, 4 CPUs
194[ 0.069114] devtmpfs: initialized
195[ 0.073281] random: get_random_u32 called from bucket_table_alloc.isra.10+0x4e/0x160 with crng_init=0
196[ 0.082157] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
197[ 0.091634] futex hash table entries: 1024 (order: 4, 65536 bytes)
198[ 0.098480] NET: Registered protocol family 16
199[ 0.114101] vgaarb: loaded
200[ 0.116397] SCSI subsystem initialized
201[ 0.120358] usbcore: registered new interface driver usbfs
202[ 0.125541] usbcore: registered new interface driver hub
203[ 0.130936] usbcore: registered new device driver usb
204[ 0.136618] clocksource: Switched to clocksource riscv_clocksource
205[ 0.148108] NET: Registered protocol family 2
206[ 0.152358] tcp_listen_portaddr_hash hash table entries: 4096 (order: 4, 65536 bytes)
207[ 0.159928] TCP established hash table entries: 65536 (order: 7, 524288 bytes)
208[ 0.169027] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes)
209[ 0.178360] TCP: Hash tables configured (established 65536 bind 65536)
210[ 0.184653] UDP hash table entries: 4096 (order: 5, 131072 bytes)
211[ 0.190819] UDP-Lite hash table entries: 4096 (order: 5, 131072 bytes)
212[ 0.197618] NET: Registered protocol family 1
213[ 0.201892] RPC: Registered named UNIX socket transport module.
214[ 0.207395] RPC: Registered udp transport module.
215[ 0.212159] RPC: Registered tcp transport module.
216[ 0.216940] RPC: Registered tcp NFSv4.1 backchannel transport module.
217[ 0.223445] PCI: CLS 0 bytes, default 64
218[ 0.227726] Unpacking initramfs...
219[ 0.260556] Freeing initrd memory: 2336K
220[ 0.264652] workingset: timestamp_bits=62 max_order=21 bucket_order=0
221[ 0.278452] NFS: Registering the id_resolver key type
222[ 0.282841] Key type id_resolver registered
223[ 0.287067] Key type id_legacy registered
224[ 0.291155] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
225[ 0.298299] NET: Registered protocol family 38
226[ 0.302470] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
227[ 0.309906] io scheduler mq-deadline registered
228[ 0.314501] io scheduler kyber registered
229[ 0.354134] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
230[ 0.360725] 10010000.serial: ttySIF0 at MMIO 0x10010000 (irq = 4, base_baud = 0) is a SiFive UART v0
231[ 0.369191] printk: console [ttySIF0] enabled
232[ 0.369191] printk: console [ttySIF0] enabled
233[ 0.377938] printk: bootconsole [sbi0] disabled
234[ 0.377938] printk: bootconsole [sbi0] disabled
235[ 0.387298] 10011000.serial: ttySIF1 at MMIO 0x10011000 (irq = 1, base_baud = 0) is a SiFive UART v0
236[ 0.396411] [drm] radeon kernel modesetting enabled.
237[ 0.409818] loop: module loaded
238[ 0.412606] libphy: Fixed MDIO Bus: probed
239[ 0.416870] macb 10090000.ethernet: Registered clk switch 'sifive-gemgxl-mgmt'
240[ 0.423570] macb: GEM doesn't support hardware ptp.
241[ 0.428469] libphy: MACB_mii_bus: probed
242[ 1.053009] Microsemi VSC8541 SyncE 10090000.ethernet-ffffffff:00: attached PHY driver [Microsemi VSC8541 SyncE] (mii_bus:phy_addr=10090000.ethernet-ffffffff:00, irq=POLL)
243[ 1.067548] macb 10090000.ethernet eth0: Cadence GEM rev 0x10070109 at 0x10090000 irq 7 (70:b3:d5:92:f2:f3)
244[ 1.077330] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
245[ 1.083069] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
246[ 1.089061] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
247[ 1.095485] ehci-pci: EHCI PCI platform driver
248[ 1.099947] ehci-platform: EHCI generic platform driver
249[ 1.105196] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
250[ 1.111286] ohci-pci: OHCI PCI platform driver
251[ 1.115742] ohci-platform: OHCI generic platform driver
252[ 1.121142] usbcore: registered new interface driver uas
253[ 1.126269] usbcore: registered new interface driver usb-storage
254[ 1.132331] mousedev: PS/2 mouse device common for all mice
255[ 1.137978] usbcore: registered new interface driver usbhid
256[ 1.143325] usbhid: USB HID core driver
257[ 1.148022] NET: Registered protocol family 10
258[ 1.152609] Segment Routing with IPv6
259[ 1.155571] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
260[ 1.161927] NET: Registered protocol family 17
261[ 1.165907] Key type dns_resolver registered
262[ 1.171694] Freeing unused kernel memory: 204K
263[ 1.175375] This architecture does not have kernel memory protection.
264[ 1.181792] Run /init as init process
265 _ _
266 | ||_|
267 | | _ ____ _ _ _ _
268 | || | _ \| | | |\ \/ /
269 | || | | | | |_| |/ \
270 |_||_|_| |_|\____|\_/\_/
271
272 Busybox Rootfs
Atish Patra75a90392019-02-25 08:15:27 +0000273
Anup Patel12b480a2019-06-25 06:31:52 +0000274Please press Enter to activate this console.
275/ #