[PATCH v2 9/9] doc: update FU540 RISC-V documentation
Pragnesh Patel
pragnesh.patel at sifive.com
Mon Jan 20 11:46:18 CET 2020
Hi Rick,
>-----Original Message-----
>From: Rick Chen <rickchen36 at gmail.com>
>Sent: 20 January 2020 11:41
>To: Pragnesh Patel <pragnesh.patel at sifive.com>
>Cc: U-Boot Mailing List <u-boot at lists.denx.de>; Atish Patra
><atish.patra at wdc.com>; palmerdabbelt at google.com; Bin Meng
><bmeng.cn at gmail.com>; Paul Walmsley ( Sifive)
><paul.walmsley at sifive.com>; Jagan Teki <jagan at amarulasolutions.com>;
>Troy Benjegerdes ( Sifive) <troy.benjegerdes at sifive.com>; Anup Patel
><anup.patel at wdc.com>; Sagar Kadam <sagar.kadam at sifive.com>; rick
><rick at andestech.com>; Alan Kao <alankao at andestech.com>
>Subject: Re: [PATCH v2 9/9] doc: update FU540 RISC-V documentation
>
>Hi Pragnesh
>
>> From: Pragnesh Patel [mailto:pragnesh.patel at sifive.com]
>> Sent: Friday, January 17, 2020 8:46 PM
>> To: u-boot at lists.denx.de
>> Cc: atish.patra at wdc.com; palmerdabbelt at google.com;
>bmeng.cn at gmail.com;
>> paul.walmsley at sifive.com; jagan at amarulasolutions.com;
>> troy.benjegerdes at sifive.com; anup.patel at wdc.com;
>> sagar.kadam at sifive.com; Pragnesh Patel; Anup Patel; Rick Jian-Zhi
>> Chen(陳建志)
>> Subject: [PATCH v2 9/9] doc: update FU540 RISC-V documentation
>>
>> Add descriptions about U-Boot SPL feature and how to build and run.
>>
>> Signed-off-by: Pragnesh Patel <pragnesh.patel at sifive.com>
>> ---
>> doc/board/sifive/fu540.rst | 370
>> +++++++++++++++++++++++++++++++++++++
>> 1 file changed, 370 insertions(+)
>>
>> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
>> index 3937222c6c..e15427414d 100644
>> --- a/doc/board/sifive/fu540.rst
>> +++ b/doc/board/sifive/fu540.rst
>> @@ -363,3 +363,373 @@ load uImage.
>>
>> Please press Enter to activate this console.
>> / #
>> +
>> +
>> +Running U-Boot SPL
>> +------------------
>> +The U-Boot SPL will boot in M mode and load the FIT image which
>> +include OpenSBI and U-Boot proper images. After loading progress, it
>> +will jump to OpenSBI first and then U-Boot proper which will run in S mode.
>> +
>> +
>> +How to build U-Boot SPL
>> +-----------------------
>> +Before building U-Boot SPL, OpenSBI must be build first. OpenSBI can
>> +be cloned and build for FU540 as below:
>> +
>
>Please add
>.. code-block:: console
Will update in v3, thanks for catching this.
>
>> +git clone https://github.com/riscv/opensbi.git
>> +cd opensbi
>> +make PLATFORM=sifive/fu540
>> +
>> +Copy OpenSBI FW_DYNAMIC image
>> +(build/platform/sifive/fu540/firmware/fw_dynamic.bin)
>> +into U-Boot root directory
>> +
>> +
>> +How to build U-Boot SPL booting from MMC
>> +----------------------------------------
>> +With sifive_fu540_spl_defconfig:
>> +
>> +1. Add the RISC-V toolchain to your PATH.
>> +2. Setup ARCH & cross compilation enviornment variable:
>> +
>> +.. code-block:: none
>> +
>> + export ARCH=riscv
>> + export CROSS_COMPILE=<riscv64 toolchain prefix>
>> +
>> +3. make sifive_fu540_spl_defconfig
>> +4. make
>> +
>> +
>> +Flashing
>> +--------
>> +
>> +The current U-Boot port is supported in S-mode only.
>> +
>> +A prior stage M-mode firmware/bootloader (e.g OpenSBI) is required to
>> +boot the u-boot.bin in S-mode and provide M-mode runtime services.
>> +
>> +First partition of the sdcard should contain "u-boot.itb" and
>> +Partition type should be of "8300 Linux filesystem".
>> +
>> +.. code-block:: none
>> +
>> + sudo dd if=spl/u-boot-spl.bin of=/dev/disk2s4 bs=1024
>> + sudo dd if=u-boot.itb of=/dev/disk2s1 bs=1024
>> +
>> +Booting
>> +-------
>> +Once you plugin the sdcard and power up, you should see the U-Boot
>prompt.
>> +
>> +Sample boot log from HiFive Unleashed board
>> +-------------------------------------------
>> +
>> +.. code-block:: none
>> +
>> + U-Boot SPL 2020.01-00176-gfb5af3c225 (Jan 16 2020 - 19:23:14 +0530)
>> + Trying to boot from MMC1
>> +
>> +
>> + U-Boot 2020.01-00176-gfb5af3c225 (Jan 16 2020 - 19:23:14 +0530)
>> +
>> + CPU: rv64imafdc
>> + Model: SiFive HiFive Unleashed A00
>> + DRAM: 8 GiB
>> + MMC: spi at 10050000:mmc at 0: 0
>> + In: serial at 10010000
>> + Out: serial at 10010000
>> + Err: serial at 10010000
>> + Board serial number should not be 0 !!
>> + Net:
>
>Please fix
>ERROR: trailing whitespace
>#98: FILE: doc/board/sifive/fu540.rst:443:
This is from bootlogs, I will fix this in v3.
>
>> + Warning: ethernet at 10090000 (eth0) using random MAC address -
>9e:33:74:04:6a:eb
>> + eth0: ethernet at 10090000
>> + Hit any key to stop autoboot: 0
>> + => version
>> + U-Boot 2020.01-00176-gfb5af3c225 (Jan 16 2020 - 19:23:14 +0530)
>> +
>> + riscv64-unknown-linux-gnu-gcc (crosstool-NG 1.24.0.37-3f461da) 9.2.0
>> + GNU ld (crosstool-NG 1.24.0.37-3f461da) 2.32
>> + => mmc info
>> + Device: spi at 10050000:mmc at 0
>> + Manufacturer ID: 3
>> + OEM: 5344
>> + Name: SC16G
>> + Bus Speed: 20000000
>> + Mode: SD Legacy
>> + Rd Block Len: 512
>> + SD version 2.0
>> + High Capacity: Yes
>> + Capacity: 14.8 GiB
>> + Bus Width: 1-bit
>> + Erase Group Size: 512 Bytes
>> + => mmc part
>> +
>> + Partition Map for MMC device 0 -- Partition Type: EFI
>> +
>> + Part Start LBA End LBA Name
>> + Attributes
>> + Type GUID
>> + Partition GUID
>> + 1 0x00000800 0x000107ff "Linux filesystem"
>> + attrs: 0x0000000000000000
>> + type: 0fc63daf-8483-4772-8e79-3d69d8477de4
>> + guid: 36aab838-b418-4342-929e-678d85fb4438
>> + 2 0x00040800 0x00ecdfde "Linux filesystem"
>> + attrs: 0x0000000000000000
>> + type: 0fc63daf-8483-4772-8e79-3d69d8477de4
>> + guid: 118ac296-e3ff-4ef2-b435-ec6a7bebdd6e
>> +
>> +Now you can configure your networking, tftp server and use tftp boot
>> +method to load uImage.
>> +
>> +.. code-block:: none
>> +
>> + => setenv serverip 172.16.35.74
>> + => setenv ipaddr 172.16.35.40
>> + => tftpboot 0x83000000 fit.itb
>> + ethernet at 10090000: PHY present at 0
>> + ethernet at 10090000: Starting autonegotiation...
>> + ethernet at 10090000: Autonegotiation complete
>> + ethernet at 10090000: link up, 100Mbps full-duplex (lpa: 0x41e1)
>> + Using ethernet at 10090000 device
>> + TFTP from server 172.16.35.74; our IP address is 172.16.35.40
>> + Filename 'fit.itb'.
>> + Load address: 0x83000000
>> + Loading:
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> +
>#################################################################
>> + ###################################
>> + 880.9 KiB/s
>> + done
>> + Bytes transferred = 13823823 (d2ef4f hex)
>> + => bootm 0x83000000
>> + ## Loading kernel from FIT Image at 83000000 ...
>> + Using 'config-1' configuration
>> + Trying 'kernel at 1' kernel subimage
>> + Description: Linux kernel
>> + Type: Kernel Image
>> + Compression: uncompressed
>> + Data Start: 0x830000d8
>> + Data Size: 9247260 Bytes = 8.8 MiB
>> + Architecture: RISC-V
>> + OS: Linux
>> + Load Address: 0x80200000
>> + Entry Point: 0x80200000
>> + Verifying Hash Integrity ... OK
>> + ## Loading ramdisk from FIT Image at 83000000 ...
>> + Using 'config-1' configuration
>> + Trying 'ramdisk at 1' ramdisk subimage
>> + Description: ramdisk
>> + Type: RAMDisk Image
>> + Compression: gzip compressed
>> + Data Start: 0x838d3378
>> + Data Size: 4568674 Bytes = 4.4 MiB
>> + Architecture: RISC-V
>> + OS: Linux
>> + Load Address: 0x82000000
>> + Entry Point: unavailable
>> + Verifying Hash Integrity ... OK
>> + Loading ramdisk from 0x838d3378 to 0x82000000
>> + WARNING: 'compression' nodes for ramdisks are deprecated, please fix
>your .its file!
>> + ## Loading fdt from FIT Image at 83000000 ...
>> + Using 'config-1' configuration
>> + Trying 'fdt at 1' fdt subimage
>> + Description: unavailable
>> + Type: Flat Device Tree
>> + Compression: uncompressed
>> + Data Start: 0x838d1b80
>> + Data Size: 6023 Bytes = 5.9 KiB
>> + Architecture: RISC-V
>> + Verifying Hash Integrity ... OK
>> + Booting using the fdt blob at 0x838d1b80
>> + Loading Kernel Image
>> + Using Device Tree in place at 00000000838d1b80, end
>> + 00000000838d6306
>> +
>> + Starting kernel ...
>> +
>> + [ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
>> + [ 0.000000] Linux version 5.3.0-13236-g97f9a3c4eee5
>(pragneshp at sachinj2-OptiPlex-7010) (gcc version 8.2.0 (Buildroot 2018.11-
>rc2-00003-ga0787e9
>> [....]
>> + [ 1.081750] NET: Registered protocol family 17
>> + [ 1.085874] 9pnet: Installing 9P2000 support
>> + [ 1.089962] Key type dns_resolver registered
>> + [ 1.096391] Freeing unused kernel memory: 208K
>> + [ 1.100047] This architecture does not have kernel memory protection.
>> + [ 1.106486] Run /init as init process
>> + Starting syslogd: OK
>> + Starting klogd: OK
>> + Starting mdev...
>> + /etc/init.d/S10mdev: line 9: can't create /proc/sys/kernel/hotplug:
>nonexistent directory
>> + [ 1.167865] mmc0: host does not support reading read-only switch,
>assuming write-enable
>> + [ 1.175122] mmc0: new SDHC card on SPI
>> + [ 1.180128] mmcblk0: mmc0:0000 SC16G 14.8 GiB
>> + [ 1.214481] mmcblk0: p1 p2 p4
>> + modprobe: can't change directory to '/lib/modules': No such file or
>directory
>> + Initializing random number generator... [ 1.655480] random: dd:
>uninitialized urandom read (512 bytes read)
>> + done.
>> + Starting network: udhcpc: started, v1.29.3
>> + udhcpc: sending discover
>> + [ 3.724710] macb 10090000.ethernet eth0: link up (100/Full)
>> + [ 3.729529] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes
>ready
>> + udhcpc: sending discover
>> + udhcpc: sending discover
>> + udhcpc: sending select for 172.16.35.78
>> + udhcpc: lease of 172.16.35.78 obtained, lease time 28800
>> + deleting routers
>> + adding dns 172.16.34.150
>> + adding dns 172.16.24.25
>> + OK
>> + Starting dropbear sshd: [ 7.932851] random: dropbear: uninitialized
>urandom read (32 bytes read)
>> + OK
>> +
>> + Welcome to Buildroot
>> + buildroot login: root
>> + Password:
>
>Please fix
>ERROR: trailing whitespace
>#389: FILE: doc/board/sifive/fu540.rst:734:
Will fix in v3, thanks.
>+ Password: $
>
>> + #
>> --
>> 2.17.1
>>
More information about the U-Boot
mailing list