diff mbox series

[v10,17/18] configs: fu540: Add config options for U-Boot SPL

Message ID 20200514115258.21042-18-pragnesh.patel@sifive.com
State Superseded
Delegated to: Andes
Headers show
Series RISC-V SiFive FU540 support SPL | expand

Commit Message

Pragnesh Patel May 14, 2020, 11:52 a.m. UTC
With sifive_fu540_defconfig:

User can use FSBL or u-boot-spl.bin anyone at a time.

For FSBL,
fsbl->fw_payload.bin (opensbi + U-Boot)

For u-boot-spl.bin,
u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)

U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
image u-boot.itb from SD card into RAM.

U-Boot SPL expects u-boot.itb FIT image at the starting of SD card sector
number (0x822) of GUID type "2E54B353-1271-4842-806F-E436D6AF6985"

Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
---
 configs/sifive_fu540_defconfig |   8 ++
 doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
 2 files changed, 142 insertions(+)

Comments

Jagan Teki May 15, 2020, 5:35 p.m. UTC | #1
On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> With sifive_fu540_defconfig:
>
> User can use FSBL or u-boot-spl.bin anyone at a time.
>
> For FSBL,
> fsbl->fw_payload.bin (opensbi + U-Boot)
>
> For u-boot-spl.bin,
> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>
> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
> image u-boot.itb from SD card into RAM.
>
> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card sector
> number (0x822) of GUID type "2E54B353-1271-4842-806F-E436D6AF6985"
>
> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  configs/sifive_fu540_defconfig |   8 ++
>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
>  2 files changed, 142 insertions(+)
>
> diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
> index f805aacc7a..8d412f8d6a 100644
> --- a/configs/sifive_fu540_defconfig
> +++ b/configs/sifive_fu540_defconfig
> @@ -1,6 +1,11 @@
>  CONFIG_RISCV=y
> +CONFIG_SPL_GPIO_SUPPORT=y
> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>  CONFIG_ENV_SIZE=0x20000
> +CONFIG_SPL_MMC_SUPPORT=y
>  CONFIG_NR_DRAM_BANKS=1
> +CONFIG_SPL=y
> +CONFIG_SPL_SPI_SUPPORT=y
>  CONFIG_TARGET_SIFIVE_FU540=y
>  CONFIG_ARCH_RV64I=y
>  CONFIG_RISCV_SMODE=y
> @@ -9,7 +14,10 @@ CONFIG_FIT=y
>  CONFIG_MISC_INIT_R=y
>  CONFIG_DISPLAY_CPUINFO=y
>  CONFIG_DISPLAY_BOARDINFO=y
> +CONFIG_SPL_SEPARATE_BSS=y
> +CONFIG_SPL_YMODEM_SUPPORT=y
>  CONFIG_OF_BOARD_FIXUP=y
>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SPL_CLK=y
>  CONFIG_DM_MTD=y
> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
> index 610ba87074..89e8d66c56 100644
> --- a/doc/board/sifive/fu540.rst
> +++ b/doc/board/sifive/fu540.rst
> @@ -31,6 +31,9 @@ TODO:
>          stdout-path = "/soc/serial@10010000:115200";
>     };
>
> +Booting from MMC using FSBL
> +---------------------------
> +
>  Building
>  --------
>
> @@ -421,3 +424,134 @@ as well.
>
>     Please press Enter to activate this console.
>     / #
> +
> +Booting from MMC using U-Boot SPL
> +---------------------------------
> +
> +Building
> +--------
> +
> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can be
> +cloned and built for FU540 as below:
> +
> +.. code-block:: console
> +
> +       git clone https://github.com/riscv/opensbi.git
> +       cd opensbi
> +       make PLATFORM=generic FW_DYNAMIC=y
> +
> +Copy OpenSBI FW_DYNAMIC image
> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
> +root directory
> +
> +.. code-block:: console
> +
> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
> +
> +Now build the U-Boot SPL and U-Boot proper
> +
> +.. code-block:: console
> +
> +       cd <U-Boot-dir>
> +       make sifive_fu540_defconfig
> +       make
> +
> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
> +
> +
> +Flashing
> +--------
> +
> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID type
> +5B193300-FC78-40CD-8002-E86C45580B47
> +
> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition with GUID
> +type 2E54B353-1271-4842-806F-E436D6AF6985
> +
> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin, u-boot-nodtb.bin and
> +device tree blob (hifive-unleashed-a00.dtb)
> +
> +Format the SD card (make sure the disk has GPT, otherwise use gdisk to switch)
> +
> +.. code-block:: none
> +
> +       # sudo sgdisk --clear \
> +       > --set-alignment=2 \
> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \
> +       > --new=2:2082:10273 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
> +       > --new=3:10274: --change-name=3:rootfs --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \
> +       > /dev/sda
> +
> +Program the SD card
> +
> +.. code-block:: none
> +
> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
> +
> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 - 13:52:36 +0530)
> +       Trying to boot from MMC1
> +
> +
> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 - 13:52:36 +0530)
> +
> +       CPU:   rv64imafdc
> +       Model: SiFive HiFive Unleashed A00
> +       DRAM:  8 GiB
> +       MMC:   spi@10050000:mmc@0: 0
> +       In:    serial@10010000
> +       Out:   serial@10010000
> +       Err:   serial@10010000
> +       Board serial number should not be 0 !!
> +       Net:
> +       Warning: ethernet@10090000 (eth0) using random MAC address - 96:06:92:18:eb:04
> +       eth0: ethernet@10090000
> +       Hit any key to stop autoboot:  0

Look like v10 seems to be a change, I can see memory region print?

U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
+0530)
Trying to boot from MMC1


U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17 +0530)

CPU:   rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM:  8 GiB
No reserved memory region found in source FDT
MMC:   spi@10050000:mmc@0: 0
In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Net:   eth0: ethernet@10090000
Hit any key to stop autoboot:  0

Jagan.
Pragnesh Patel May 16, 2020, 6:12 a.m. UTC | #2
Hi Jagan,

>-----Original Message-----
>From: Jagan Teki <jagan@amarulasolutions.com>
>Sent: 15 May 2020 23:05
>To: Pragnesh Patel <pragnesh.patel@sifive.com>
>Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Bin
>Meng <bmeng.cn@gmail.com>; Paul Walmsley <paul.walmsley@sifive.com>;
>Anup Patel <anup.patel@wdc.com>; Sagar Kadam
><sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
>Dabbelt <palmer@dabbelt.com>
>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
>SPL
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
><pragnesh.patel@sifive.com> wrote:
>>
>> With sifive_fu540_defconfig:
>>
>> User can use FSBL or u-boot-spl.bin anyone at a time.
>>
>> For FSBL,
>> fsbl->fw_payload.bin (opensbi + U-Boot)
>>
>> For u-boot-spl.bin,
>> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>>
>> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
>> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
>> image u-boot.itb from SD card into RAM.
>>
>> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card
>> sector number (0x822) of GUID type "2E54B353-1271-4842-806F-
>E436D6AF6985"
>>
>> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>> ---
>>  configs/sifive_fu540_defconfig |   8 ++
>>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
>>  2 files changed, 142 insertions(+)
>>
>> diff --git a/configs/sifive_fu540_defconfig
>> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a 100644
>> --- a/configs/sifive_fu540_defconfig
>> +++ b/configs/sifive_fu540_defconfig
>> @@ -1,6 +1,11 @@
>>  CONFIG_RISCV=y
>> +CONFIG_SPL_GPIO_SUPPORT=y
>> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>>  CONFIG_ENV_SIZE=0x20000
>> +CONFIG_SPL_MMC_SUPPORT=y
>>  CONFIG_NR_DRAM_BANKS=1
>> +CONFIG_SPL=y
>> +CONFIG_SPL_SPI_SUPPORT=y
>>  CONFIG_TARGET_SIFIVE_FU540=y
>>  CONFIG_ARCH_RV64I=y
>>  CONFIG_RISCV_SMODE=y
>> @@ -9,7 +14,10 @@ CONFIG_FIT=y
>>  CONFIG_MISC_INIT_R=y
>>  CONFIG_DISPLAY_CPUINFO=y
>>  CONFIG_DISPLAY_BOARDINFO=y
>> +CONFIG_SPL_SEPARATE_BSS=y
>> +CONFIG_SPL_YMODEM_SUPPORT=y
>>  CONFIG_OF_BOARD_FIXUP=y
>>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>> +CONFIG_SPL_CLK=y
>>  CONFIG_DM_MTD=y
>> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
>> index 610ba87074..89e8d66c56 100644
>> --- a/doc/board/sifive/fu540.rst
>> +++ b/doc/board/sifive/fu540.rst
>> @@ -31,6 +31,9 @@ TODO:
>>          stdout-path = "/soc/serial@10010000:115200";
>>     };
>>
>> +Booting from MMC using FSBL
>> +---------------------------
>> +
>>  Building
>>  --------
>>
>> @@ -421,3 +424,134 @@ as well.
>>
>>     Please press Enter to activate this console.
>>     / #
>> +
>> +Booting from MMC using U-Boot SPL
>> +---------------------------------
>> +
>> +Building
>> +--------
>> +
>> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can
>> +be cloned and built for FU540 as below:
>> +
>> +.. code-block:: console
>> +
>> +       git clone https://github.com/riscv/opensbi.git
>> +       cd opensbi
>> +       make PLATFORM=generic FW_DYNAMIC=y
>> +
>> +Copy OpenSBI FW_DYNAMIC image
>> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot root
>> +directory
>> +
>> +.. code-block:: console
>> +
>> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
>> +
>> +Now build the U-Boot SPL and U-Boot proper
>> +
>> +.. code-block:: console
>> +
>> +       cd <U-Boot-dir>
>> +       make sifive_fu540_defconfig
>> +       make
>> +
>> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
>> +
>> +
>> +Flashing
>> +--------
>> +
>> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID
>> +type
>> +5B193300-FC78-40CD-8002-E86C45580B47
>> +
>> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition
>> +with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
>> +
>> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
>> +u-boot-nodtb.bin and device tree blob (hifive-unleashed-a00.dtb)
>> +
>> +Format the SD card (make sure the disk has GPT, otherwise use gdisk
>> +to switch)
>> +
>> +.. code-block:: none
>> +
>> +       # sudo sgdisk --clear \
>> +       > --set-alignment=2 \
>> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-
>FC78-40CD-8002-E86C45580B47 \
>> +       > --new=2:2082:10273 --change-name=2:loader2 --
>typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
>> +       > --new=3:10274: --change-name=3:rootfs --typecode=3:0FC63DAF-
>8483-4772-8E79-3D69D8477DE4 \
>> +       > /dev/sda
>> +
>> +Program the SD card
>> +
>> +.. code-block:: none
>> +
>> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
>> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
>> +
>> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
>13:52:36 +0530)
>> +       Trying to boot from MMC1
>> +
>> +
>> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
>> + 13:52:36 +0530)
>> +
>> +       CPU:   rv64imafdc
>> +       Model: SiFive HiFive Unleashed A00
>> +       DRAM:  8 GiB
>> +       MMC:   spi@10050000:mmc@0: 0
>> +       In:    serial@10010000
>> +       Out:   serial@10010000
>> +       Err:   serial@10010000
>> +       Board serial number should not be 0 !!
>> +       Net:
>> +       Warning: ethernet@10090000 (eth0) using random MAC address -
>96:06:92:18:eb:04
>> +       eth0: ethernet@10090000
>> +       Hit any key to stop autoboot:  0
>
>Look like v10 seems to be a change, I can see memory region print?
>
>U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
>+0530)
>Trying to boot from MMC1
>
>
>U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17 +0530)
>
>CPU:   rv64imafdc
>Model: SiFive HiFive Unleashed A00
>DRAM:  8 GiB
>No reserved memory region found in source FDT
>MMC:   spi@10050000:mmc@0: 0
>In:    serial@10010000
>Out:   serial@10010000
>Err:   serial@10010000
>Net:   eth0: ethernet@10090000
>Hit any key to stop autoboot:  0

I haven't got this "memory region" print, can you please update your U-Boot and OpenSBI
Repo and recheck.

U-Boot SPL 2020.07-rc2-00681-gcbf8ba388d (May 16 2020 - 11:36:52 +0530)
Trying to boot from MMC1


U-Boot 2020.07-rc2-00681-gcbf8ba388d (May 16 2020 - 11:36:52 +0530)

CPU:   rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM:  8 GiB
MMC:   spi@10050000:mmc@0: 0
In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Board serial number should not be 0 !!
Net:
Warning: ethernet@10090000 (eth0) using random MAC address - 22:48:01:00:fc:6c
eth0: ethernet@10090000
Hit any key to stop autoboot:  0
=>

>
>Jagan.
Bin Meng May 17, 2020, 12:57 p.m. UTC | #3
Hi Pragnesh,

On Thu, May 14, 2020 at 7:54 PM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> With sifive_fu540_defconfig:
>
> User can use FSBL or u-boot-spl.bin anyone at a time.
>
> For FSBL,
> fsbl->fw_payload.bin (opensbi + U-Boot)
>
> For u-boot-spl.bin,
> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>
> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
> image u-boot.itb from SD card into RAM.
>
> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card sector
> number (0x822) of GUID type "2E54B353-1271-4842-806F-E436D6AF6985"
>
> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> ---
>  configs/sifive_fu540_defconfig |   8 ++
>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
>  2 files changed, 142 insertions(+)
>
> diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
> index f805aacc7a..8d412f8d6a 100644
> --- a/configs/sifive_fu540_defconfig
> +++ b/configs/sifive_fu540_defconfig
> @@ -1,6 +1,11 @@
>  CONFIG_RISCV=y
> +CONFIG_SPL_GPIO_SUPPORT=y
> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>  CONFIG_ENV_SIZE=0x20000
> +CONFIG_SPL_MMC_SUPPORT=y
>  CONFIG_NR_DRAM_BANKS=1
> +CONFIG_SPL=y
> +CONFIG_SPL_SPI_SUPPORT=y
>  CONFIG_TARGET_SIFIVE_FU540=y
>  CONFIG_ARCH_RV64I=y
>  CONFIG_RISCV_SMODE=y
> @@ -9,7 +14,10 @@ CONFIG_FIT=y
>  CONFIG_MISC_INIT_R=y
>  CONFIG_DISPLAY_CPUINFO=y
>  CONFIG_DISPLAY_BOARDINFO=y
> +CONFIG_SPL_SEPARATE_BSS=y
> +CONFIG_SPL_YMODEM_SUPPORT=y
>  CONFIG_OF_BOARD_FIXUP=y
>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> +CONFIG_SPL_CLK=y
>  CONFIG_DM_MTD=y
> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
> index 610ba87074..89e8d66c56 100644
> --- a/doc/board/sifive/fu540.rst
> +++ b/doc/board/sifive/fu540.rst
> @@ -31,6 +31,9 @@ TODO:
>          stdout-path = "/soc/serial@10010000:115200";
>     };
>
> +Booting from MMC using FSBL
> +---------------------------
> +
>  Building
>  --------
>
> @@ -421,3 +424,134 @@ as well.
>
>     Please press Enter to activate this console.
>     / #
> +
> +Booting from MMC using U-Boot SPL
> +---------------------------------
> +
> +Building
> +--------
> +
> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can be
> +cloned and built for FU540 as below:
> +
> +.. code-block:: console
> +
> +       git clone https://github.com/riscv/opensbi.git
> +       cd opensbi
> +       make PLATFORM=generic FW_DYNAMIC=y
> +
> +Copy OpenSBI FW_DYNAMIC image
> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
> +root directory
> +
> +.. code-block:: console
> +
> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
> +
> +Now build the U-Boot SPL and U-Boot proper
> +
> +.. code-block:: console
> +
> +       cd <U-Boot-dir>
> +       make sifive_fu540_defconfig
> +       make
> +
> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
> +
> +
> +Flashing
> +--------
> +
> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID type
> +5B193300-FC78-40CD-8002-E86C45580B47
> +
> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition with GUID
> +type 2E54B353-1271-4842-806F-E436D6AF6985
> +
> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin, u-boot-nodtb.bin and
> +device tree blob (hifive-unleashed-a00.dtb)
> +
> +Format the SD card (make sure the disk has GPT, otherwise use gdisk to switch)
> +
> +.. code-block:: none
> +
> +       # sudo sgdisk --clear \
> +       > --set-alignment=2 \
> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \
> +       > --new=2:2082:10273 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
> +       > --new=3:10274: --change-name=3:rootfs --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \

The LBAs in this command do not match what is proposed in this patch:

http://patchwork.ozlabs.org/project/uboot/patch/20200514115258.21042-16-pragnesh.patel@sifive.com/

> +       > /dev/sda
> +
> +Program the SD card
> +
> +.. code-block:: none
> +
> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082

ditto

Regards,
Bin
Pragnesh Patel May 17, 2020, 2:37 p.m. UTC | #4
Hi Bin,

>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: 17 May 2020 18:28
>To: Pragnesh Patel <pragnesh.patel@sifive.com>
>Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Atish Patra
><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Paul
>Walmsley <paul.walmsley@sifive.com>; Jagan Teki
><jagan@amarulasolutions.com>; Anup Patel <anup.patel@wdc.com>; Sagar
>Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
>Dabbelt <palmer@dabbelt.com>
>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
>SPL
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>Hi Pragnesh,
>
>On Thu, May 14, 2020 at 7:54 PM Pragnesh Patel
><pragnesh.patel@sifive.com> wrote:
>>
>> With sifive_fu540_defconfig:
>>
>> User can use FSBL or u-boot-spl.bin anyone at a time.
>>
>> For FSBL,
>> fsbl->fw_payload.bin (opensbi + U-Boot)
>>
>> For u-boot-spl.bin,
>> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>>
>> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
>> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
>> image u-boot.itb from SD card into RAM.
>>
>> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card
>> sector number (0x822) of GUID type "2E54B353-1271-4842-806F-
>E436D6AF6985"
>>
>> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
>> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>> ---
>>  configs/sifive_fu540_defconfig |   8 ++
>>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
>>  2 files changed, 142 insertions(+)
>>
>> diff --git a/configs/sifive_fu540_defconfig
>> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a 100644
>> --- a/configs/sifive_fu540_defconfig
>> +++ b/configs/sifive_fu540_defconfig
>> @@ -1,6 +1,11 @@
>>  CONFIG_RISCV=y
>> +CONFIG_SPL_GPIO_SUPPORT=y
>> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>>  CONFIG_ENV_SIZE=0x20000
>> +CONFIG_SPL_MMC_SUPPORT=y
>>  CONFIG_NR_DRAM_BANKS=1
>> +CONFIG_SPL=y
>> +CONFIG_SPL_SPI_SUPPORT=y
>>  CONFIG_TARGET_SIFIVE_FU540=y
>>  CONFIG_ARCH_RV64I=y
>>  CONFIG_RISCV_SMODE=y
>> @@ -9,7 +14,10 @@ CONFIG_FIT=y
>>  CONFIG_MISC_INIT_R=y
>>  CONFIG_DISPLAY_CPUINFO=y
>>  CONFIG_DISPLAY_BOARDINFO=y
>> +CONFIG_SPL_SEPARATE_BSS=y
>> +CONFIG_SPL_YMODEM_SUPPORT=y
>>  CONFIG_OF_BOARD_FIXUP=y
>>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>> +CONFIG_SPL_CLK=y
>>  CONFIG_DM_MTD=y
>> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
>> index 610ba87074..89e8d66c56 100644
>> --- a/doc/board/sifive/fu540.rst
>> +++ b/doc/board/sifive/fu540.rst
>> @@ -31,6 +31,9 @@ TODO:
>>          stdout-path = "/soc/serial@10010000:115200";
>>     };
>>
>> +Booting from MMC using FSBL
>> +---------------------------
>> +
>>  Building
>>  --------
>>
>> @@ -421,3 +424,134 @@ as well.
>>
>>     Please press Enter to activate this console.
>>     / #
>> +
>> +Booting from MMC using U-Boot SPL
>> +---------------------------------
>> +
>> +Building
>> +--------
>> +
>> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can
>> +be cloned and built for FU540 as below:
>> +
>> +.. code-block:: console
>> +
>> +       git clone https://github.com/riscv/opensbi.git
>> +       cd opensbi
>> +       make PLATFORM=generic FW_DYNAMIC=y
>> +
>> +Copy OpenSBI FW_DYNAMIC image
>> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot root
>> +directory
>> +
>> +.. code-block:: console
>> +
>> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
>> +
>> +Now build the U-Boot SPL and U-Boot proper
>> +
>> +.. code-block:: console
>> +
>> +       cd <U-Boot-dir>
>> +       make sifive_fu540_defconfig
>> +       make
>> +
>> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
>> +
>> +
>> +Flashing
>> +--------
>> +
>> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID
>> +type
>> +5B193300-FC78-40CD-8002-E86C45580B47
>> +
>> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition
>> +with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
>> +
>> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
>> +u-boot-nodtb.bin and device tree blob (hifive-unleashed-a00.dtb)
>> +
>> +Format the SD card (make sure the disk has GPT, otherwise use gdisk
>> +to switch)
>> +
>> +.. code-block:: none
>> +
>> +       # sudo sgdisk --clear \
>> +       > --set-alignment=2 \
>> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-
>FC78-40CD-8002-E86C45580B47 \
>> +       > --new=2:2082:10273 --change-name=2:loader2 --
>typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
>> +       > --new=3:10274: --change-name=3:rootfs
>> + --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \
>
>The LBAs in this command do not match what is proposed in this patch:
>
>http://patchwork.ozlabs.org/project/uboot/patch/20200514115258.21042-
>16-pragnesh.patel@sifive.com/

I think the LBAs are in decimal here in this patch and hex in the proposed patch.

>
>> +       > /dev/sda
>> +
>> +Program the SD card
>> +
>> +.. code-block:: none
>> +
>> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
>> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
>
>ditto

Same as above.

>
>Regards,
>Bin
Bin Meng May 17, 2020, 2:42 p.m. UTC | #5
Hi Pragnesh,

On Sun, May 17, 2020 at 10:37 PM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> Hi Bin,
>
> >-----Original Message-----
> >From: Bin Meng <bmeng.cn@gmail.com>
> >Sent: 17 May 2020 18:28
> >To: Pragnesh Patel <pragnesh.patel@sifive.com>
> >Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Atish Patra
> ><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Paul
> >Walmsley <paul.walmsley@sifive.com>; Jagan Teki
> ><jagan@amarulasolutions.com>; Anup Patel <anup.patel@wdc.com>; Sagar
> >Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
> >Dabbelt <palmer@dabbelt.com>
> >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
> >SPL
> >
> >[External Email] Do not click links or attachments unless you recognize the
> >sender and know the content is safe
> >
> >Hi Pragnesh,
> >
> >On Thu, May 14, 2020 at 7:54 PM Pragnesh Patel
> ><pragnesh.patel@sifive.com> wrote:
> >>
> >> With sifive_fu540_defconfig:
> >>
> >> User can use FSBL or u-boot-spl.bin anyone at a time.
> >>
> >> For FSBL,
> >> fsbl->fw_payload.bin (opensbi + U-Boot)
> >>
> >> For u-boot-spl.bin,
> >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
> >>
> >> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
> >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
> >> image u-boot.itb from SD card into RAM.
> >>
> >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card
> >> sector number (0x822) of GUID type "2E54B353-1271-4842-806F-
> >E436D6AF6985"
> >>
> >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> >> ---
> >>  configs/sifive_fu540_defconfig |   8 ++
> >>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
> >>  2 files changed, 142 insertions(+)
> >>
> >> diff --git a/configs/sifive_fu540_defconfig
> >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a 100644
> >> --- a/configs/sifive_fu540_defconfig
> >> +++ b/configs/sifive_fu540_defconfig
> >> @@ -1,6 +1,11 @@
> >>  CONFIG_RISCV=y
> >> +CONFIG_SPL_GPIO_SUPPORT=y
> >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
> >>  CONFIG_ENV_SIZE=0x20000
> >> +CONFIG_SPL_MMC_SUPPORT=y
> >>  CONFIG_NR_DRAM_BANKS=1
> >> +CONFIG_SPL=y
> >> +CONFIG_SPL_SPI_SUPPORT=y
> >>  CONFIG_TARGET_SIFIVE_FU540=y
> >>  CONFIG_ARCH_RV64I=y
> >>  CONFIG_RISCV_SMODE=y
> >> @@ -9,7 +14,10 @@ CONFIG_FIT=y
> >>  CONFIG_MISC_INIT_R=y
> >>  CONFIG_DISPLAY_CPUINFO=y
> >>  CONFIG_DISPLAY_BOARDINFO=y
> >> +CONFIG_SPL_SEPARATE_BSS=y
> >> +CONFIG_SPL_YMODEM_SUPPORT=y
> >>  CONFIG_OF_BOARD_FIXUP=y
> >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
> >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> >> +CONFIG_SPL_CLK=y
> >>  CONFIG_DM_MTD=y
> >> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
> >> index 610ba87074..89e8d66c56 100644
> >> --- a/doc/board/sifive/fu540.rst
> >> +++ b/doc/board/sifive/fu540.rst
> >> @@ -31,6 +31,9 @@ TODO:
> >>          stdout-path = "/soc/serial@10010000:115200";
> >>     };
> >>
> >> +Booting from MMC using FSBL
> >> +---------------------------
> >> +
> >>  Building
> >>  --------
> >>
> >> @@ -421,3 +424,134 @@ as well.
> >>
> >>     Please press Enter to activate this console.
> >>     / #
> >> +
> >> +Booting from MMC using U-Boot SPL
> >> +---------------------------------
> >> +
> >> +Building
> >> +--------
> >> +
> >> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can
> >> +be cloned and built for FU540 as below:
> >> +
> >> +.. code-block:: console
> >> +
> >> +       git clone https://github.com/riscv/opensbi.git
> >> +       cd opensbi
> >> +       make PLATFORM=generic FW_DYNAMIC=y
> >> +
> >> +Copy OpenSBI FW_DYNAMIC image
> >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot root
> >> +directory
> >> +
> >> +.. code-block:: console
> >> +
> >> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
> >> +
> >> +Now build the U-Boot SPL and U-Boot proper
> >> +
> >> +.. code-block:: console
> >> +
> >> +       cd <U-Boot-dir>
> >> +       make sifive_fu540_defconfig
> >> +       make
> >> +
> >> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
> >> +
> >> +
> >> +Flashing
> >> +--------
> >> +
> >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID
> >> +type
> >> +5B193300-FC78-40CD-8002-E86C45580B47
> >> +
> >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition
> >> +with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
> >> +
> >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
> >> +u-boot-nodtb.bin and device tree blob (hifive-unleashed-a00.dtb)
> >> +
> >> +Format the SD card (make sure the disk has GPT, otherwise use gdisk
> >> +to switch)
> >> +
> >> +.. code-block:: none
> >> +
> >> +       # sudo sgdisk --clear \
> >> +       > --set-alignment=2 \
> >> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-
> >FC78-40CD-8002-E86C45580B47 \
> >> +       > --new=2:2082:10273 --change-name=2:loader2 --
> >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
> >> +       > --new=3:10274: --change-name=3:rootfs
> >> + --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \
> >
> >The LBAs in this command do not match what is proposed in this patch:
> >
> >http://patchwork.ozlabs.org/project/uboot/patch/20200514115258.21042-
> >16-pragnesh.patel@sifive.com/
>
> I think the LBAs are in decimal here in this patch and hex in the proposed patch.
>

Ah, yes! Needs to get some sleep :)

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Regards,
Bin
Jagan Teki May 19, 2020, 4:11 p.m. UTC | #6
On Sat, May 16, 2020 at 11:42 AM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> Hi Jagan,
>
> >-----Original Message-----
> >From: Jagan Teki <jagan@amarulasolutions.com>
> >Sent: 15 May 2020 23:05
> >To: Pragnesh Patel <pragnesh.patel@sifive.com>
> >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
> ><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Bin
> >Meng <bmeng.cn@gmail.com>; Paul Walmsley <paul.walmsley@sifive.com>;
> >Anup Patel <anup.patel@wdc.com>; Sagar Kadam
> ><sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
> >Dabbelt <palmer@dabbelt.com>
> >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
> >SPL
> >
> >[External Email] Do not click links or attachments unless you recognize the
> >sender and know the content is safe
> >
> >On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
> ><pragnesh.patel@sifive.com> wrote:
> >>
> >> With sifive_fu540_defconfig:
> >>
> >> User can use FSBL or u-boot-spl.bin anyone at a time.
> >>
> >> For FSBL,
> >> fsbl->fw_payload.bin (opensbi + U-Boot)
> >>
> >> For u-boot-spl.bin,
> >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
> >>
> >> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
> >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
> >> image u-boot.itb from SD card into RAM.
> >>
> >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card
> >> sector number (0x822) of GUID type "2E54B353-1271-4842-806F-
> >E436D6AF6985"
> >>
> >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> >> ---
> >>  configs/sifive_fu540_defconfig |   8 ++
> >>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
> >>  2 files changed, 142 insertions(+)
> >>
> >> diff --git a/configs/sifive_fu540_defconfig
> >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a 100644
> >> --- a/configs/sifive_fu540_defconfig
> >> +++ b/configs/sifive_fu540_defconfig
> >> @@ -1,6 +1,11 @@
> >>  CONFIG_RISCV=y
> >> +CONFIG_SPL_GPIO_SUPPORT=y
> >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
> >>  CONFIG_ENV_SIZE=0x20000
> >> +CONFIG_SPL_MMC_SUPPORT=y
> >>  CONFIG_NR_DRAM_BANKS=1
> >> +CONFIG_SPL=y
> >> +CONFIG_SPL_SPI_SUPPORT=y
> >>  CONFIG_TARGET_SIFIVE_FU540=y
> >>  CONFIG_ARCH_RV64I=y
> >>  CONFIG_RISCV_SMODE=y
> >> @@ -9,7 +14,10 @@ CONFIG_FIT=y
> >>  CONFIG_MISC_INIT_R=y
> >>  CONFIG_DISPLAY_CPUINFO=y
> >>  CONFIG_DISPLAY_BOARDINFO=y
> >> +CONFIG_SPL_SEPARATE_BSS=y
> >> +CONFIG_SPL_YMODEM_SUPPORT=y
> >>  CONFIG_OF_BOARD_FIXUP=y
> >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
> >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> >> +CONFIG_SPL_CLK=y
> >>  CONFIG_DM_MTD=y
> >> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
> >> index 610ba87074..89e8d66c56 100644
> >> --- a/doc/board/sifive/fu540.rst
> >> +++ b/doc/board/sifive/fu540.rst
> >> @@ -31,6 +31,9 @@ TODO:
> >>          stdout-path = "/soc/serial@10010000:115200";
> >>     };
> >>
> >> +Booting from MMC using FSBL
> >> +---------------------------
> >> +
> >>  Building
> >>  --------
> >>
> >> @@ -421,3 +424,134 @@ as well.
> >>
> >>     Please press Enter to activate this console.
> >>     / #
> >> +
> >> +Booting from MMC using U-Boot SPL
> >> +---------------------------------
> >> +
> >> +Building
> >> +--------
> >> +
> >> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can
> >> +be cloned and built for FU540 as below:
> >> +
> >> +.. code-block:: console
> >> +
> >> +       git clone https://github.com/riscv/opensbi.git
> >> +       cd opensbi
> >> +       make PLATFORM=generic FW_DYNAMIC=y
> >> +
> >> +Copy OpenSBI FW_DYNAMIC image
> >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot root
> >> +directory
> >> +
> >> +.. code-block:: console
> >> +
> >> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
> >> +
> >> +Now build the U-Boot SPL and U-Boot proper
> >> +
> >> +.. code-block:: console
> >> +
> >> +       cd <U-Boot-dir>
> >> +       make sifive_fu540_defconfig
> >> +       make
> >> +
> >> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
> >> +
> >> +
> >> +Flashing
> >> +--------
> >> +
> >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID
> >> +type
> >> +5B193300-FC78-40CD-8002-E86C45580B47
> >> +
> >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition
> >> +with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
> >> +
> >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
> >> +u-boot-nodtb.bin and device tree blob (hifive-unleashed-a00.dtb)
> >> +
> >> +Format the SD card (make sure the disk has GPT, otherwise use gdisk
> >> +to switch)
> >> +
> >> +.. code-block:: none
> >> +
> >> +       # sudo sgdisk --clear \
> >> +       > --set-alignment=2 \
> >> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-
> >FC78-40CD-8002-E86C45580B47 \
> >> +       > --new=2:2082:10273 --change-name=2:loader2 --
> >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
> >> +       > --new=3:10274: --change-name=3:rootfs --typecode=3:0FC63DAF-
> >8483-4772-8E79-3D69D8477DE4 \
> >> +       > /dev/sda
> >> +
> >> +Program the SD card
> >> +
> >> +.. code-block:: none
> >> +
> >> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
> >> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
> >> +
> >> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
> >13:52:36 +0530)
> >> +       Trying to boot from MMC1
> >> +
> >> +
> >> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
> >> + 13:52:36 +0530)
> >> +
> >> +       CPU:   rv64imafdc
> >> +       Model: SiFive HiFive Unleashed A00
> >> +       DRAM:  8 GiB
> >> +       MMC:   spi@10050000:mmc@0: 0
> >> +       In:    serial@10010000
> >> +       Out:   serial@10010000
> >> +       Err:   serial@10010000
> >> +       Board serial number should not be 0 !!
> >> +       Net:
> >> +       Warning: ethernet@10090000 (eth0) using random MAC address -
> >96:06:92:18:eb:04
> >> +       eth0: ethernet@10090000
> >> +       Hit any key to stop autoboot:  0
> >
> >Look like v10 seems to be a change, I can see memory region print?
> >
> >U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
> >+0530)
> >Trying to boot from MMC1
> >
> >
> >U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17 +0530)
> >
> >CPU:   rv64imafdc
> >Model: SiFive HiFive Unleashed A00
> >DRAM:  8 GiB
> >No reserved memory region found in source FDT
> >MMC:   spi@10050000:mmc@0: 0
> >In:    serial@10010000
> >Out:   serial@10010000
> >Err:   serial@10010000
> >Net:   eth0: ethernet@10090000
> >Hit any key to stop autoboot:  0
>
> I haven't got this "memory region" print, can you please update your U-Boot and OpenSBI
> Repo and recheck.

I have checked with latest opensbi, still got it.

U-Boot SPL 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36 +0530)
Trying to boot from MMC1

OpenSBI v0.6
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name          : SiFive Freedom U540
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs     : 5
Current Hart           : 3
Firmware Base          : 0x80000000
Firmware Size          : 100 KB
Runtime SBI Version    : 0.2

MIDELEG : 0x0000000000000222
MEDELEG : 0x000000000000b109
PMP0    : 0x0000000080000000-0x000000008001ffff (A)
PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)


U-Boot 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36 +0530)

CPU:   rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM:  8 GiB
No reserved memory region found in source FDT
MMC:   spi@10050000:mmc@0: 0
In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Net:   eth0: ethernet@10090000
Hit any key to stop autoboot:  0

opensbi sha1:
89ba63493c4ce98861144180e408d6db391fd1c3

gcc version:
gcc version 8.4.0 (Buildroot 2020.05-git-00692-gd645010af2)

Jagan.
Bin Meng May 20, 2020, 4:37 a.m. UTC | #7
Hi Jagan,

On Wed, May 20, 2020 at 12:11 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> On Sat, May 16, 2020 at 11:42 AM Pragnesh Patel
> <pragnesh.patel@sifive.com> wrote:
> >
> > Hi Jagan,
> >
> > >-----Original Message-----
> > >From: Jagan Teki <jagan@amarulasolutions.com>
> > >Sent: 15 May 2020 23:05
> > >To: Pragnesh Patel <pragnesh.patel@sifive.com>
> > >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
> > ><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Bin
> > >Meng <bmeng.cn@gmail.com>; Paul Walmsley <paul.walmsley@sifive.com>;
> > >Anup Patel <anup.patel@wdc.com>; Sagar Kadam
> > ><sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
> > >Dabbelt <palmer@dabbelt.com>
> > >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
> > >SPL
> > >
> > >[External Email] Do not click links or attachments unless you recognize the
> > >sender and know the content is safe
> > >
> > >On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
> > ><pragnesh.patel@sifive.com> wrote:
> > >>
> > >> With sifive_fu540_defconfig:
> > >>
> > >> User can use FSBL or u-boot-spl.bin anyone at a time.
> > >>
> > >> For FSBL,
> > >> fsbl->fw_payload.bin (opensbi + U-Boot)
> > >>
> > >> For u-boot-spl.bin,
> > >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
> > >>
> > >> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin with
> > >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load FIT
> > >> image u-boot.itb from SD card into RAM.
> > >>
> > >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD card
> > >> sector number (0x822) of GUID type "2E54B353-1271-4842-806F-
> > >E436D6AF6985"
> > >>
> > >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> > >> ---
> > >>  configs/sifive_fu540_defconfig |   8 ++
> > >>  doc/board/sifive/fu540.rst     | 134 +++++++++++++++++++++++++++++++++
> > >>  2 files changed, 142 insertions(+)
> > >>
> > >> diff --git a/configs/sifive_fu540_defconfig
> > >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a 100644
> > >> --- a/configs/sifive_fu540_defconfig
> > >> +++ b/configs/sifive_fu540_defconfig
> > >> @@ -1,6 +1,11 @@
> > >>  CONFIG_RISCV=y
> > >> +CONFIG_SPL_GPIO_SUPPORT=y
> > >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
> > >>  CONFIG_ENV_SIZE=0x20000
> > >> +CONFIG_SPL_MMC_SUPPORT=y
> > >>  CONFIG_NR_DRAM_BANKS=1
> > >> +CONFIG_SPL=y
> > >> +CONFIG_SPL_SPI_SUPPORT=y
> > >>  CONFIG_TARGET_SIFIVE_FU540=y
> > >>  CONFIG_ARCH_RV64I=y
> > >>  CONFIG_RISCV_SMODE=y
> > >> @@ -9,7 +14,10 @@ CONFIG_FIT=y
> > >>  CONFIG_MISC_INIT_R=y
> > >>  CONFIG_DISPLAY_CPUINFO=y
> > >>  CONFIG_DISPLAY_BOARDINFO=y
> > >> +CONFIG_SPL_SEPARATE_BSS=y
> > >> +CONFIG_SPL_YMODEM_SUPPORT=y
> > >>  CONFIG_OF_BOARD_FIXUP=y
> > >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
> > >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> > >> +CONFIG_SPL_CLK=y
> > >>  CONFIG_DM_MTD=y
> > >> diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
> > >> index 610ba87074..89e8d66c56 100644
> > >> --- a/doc/board/sifive/fu540.rst
> > >> +++ b/doc/board/sifive/fu540.rst
> > >> @@ -31,6 +31,9 @@ TODO:
> > >>          stdout-path = "/soc/serial@10010000:115200";
> > >>     };
> > >>
> > >> +Booting from MMC using FSBL
> > >> +---------------------------
> > >> +
> > >>  Building
> > >>  --------
> > >>
> > >> @@ -421,3 +424,134 @@ as well.
> > >>
> > >>     Please press Enter to activate this console.
> > >>     / #
> > >> +
> > >> +Booting from MMC using U-Boot SPL
> > >> +---------------------------------
> > >> +
> > >> +Building
> > >> +--------
> > >> +
> > >> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can
> > >> +be cloned and built for FU540 as below:
> > >> +
> > >> +.. code-block:: console
> > >> +
> > >> +       git clone https://github.com/riscv/opensbi.git
> > >> +       cd opensbi
> > >> +       make PLATFORM=generic FW_DYNAMIC=y
> > >> +
> > >> +Copy OpenSBI FW_DYNAMIC image
> > >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot root
> > >> +directory
> > >> +
> > >> +.. code-block:: console
> > >> +
> > >> +       cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
> > >> +
> > >> +Now build the U-Boot SPL and U-Boot proper
> > >> +
> > >> +.. code-block:: console
> > >> +
> > >> +       cd <U-Boot-dir>
> > >> +       make sifive_fu540_defconfig
> > >> +       make
> > >> +
> > >> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
> > >> +
> > >> +
> > >> +Flashing
> > >> +--------
> > >> +
> > >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID
> > >> +type
> > >> +5B193300-FC78-40CD-8002-E86C45580B47
> > >> +
> > >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition
> > >> +with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
> > >> +
> > >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
> > >> +u-boot-nodtb.bin and device tree blob (hifive-unleashed-a00.dtb)
> > >> +
> > >> +Format the SD card (make sure the disk has GPT, otherwise use gdisk
> > >> +to switch)
> > >> +
> > >> +.. code-block:: none
> > >> +
> > >> +       # sudo sgdisk --clear \
> > >> +       > --set-alignment=2 \
> > >> +       > --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-
> > >FC78-40CD-8002-E86C45580B47 \
> > >> +       > --new=2:2082:10273 --change-name=2:loader2 --
> > >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
> > >> +       > --new=3:10274: --change-name=3:rootfs --typecode=3:0FC63DAF-
> > >8483-4772-8E79-3D69D8477DE4 \
> > >> +       > /dev/sda
> > >> +
> > >> +Program the SD card
> > >> +
> > >> +.. code-block:: none
> > >> +
> > >> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
> > >> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
> > >> +
> > >> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
> > >13:52:36 +0530)
> > >> +       Trying to boot from MMC1
> > >> +
> > >> +
> > >> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
> > >> + 13:52:36 +0530)
> > >> +
> > >> +       CPU:   rv64imafdc
> > >> +       Model: SiFive HiFive Unleashed A00
> > >> +       DRAM:  8 GiB
> > >> +       MMC:   spi@10050000:mmc@0: 0
> > >> +       In:    serial@10010000
> > >> +       Out:   serial@10010000
> > >> +       Err:   serial@10010000
> > >> +       Board serial number should not be 0 !!
> > >> +       Net:
> > >> +       Warning: ethernet@10090000 (eth0) using random MAC address -
> > >96:06:92:18:eb:04
> > >> +       eth0: ethernet@10090000
> > >> +       Hit any key to stop autoboot:  0
> > >
> > >Look like v10 seems to be a change, I can see memory region print?
> > >
> > >U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
> > >+0530)
> > >Trying to boot from MMC1
> > >
> > >
> > >U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17 +0530)
> > >
> > >CPU:   rv64imafdc
> > >Model: SiFive HiFive Unleashed A00
> > >DRAM:  8 GiB
> > >No reserved memory region found in source FDT
> > >MMC:   spi@10050000:mmc@0: 0
> > >In:    serial@10010000
> > >Out:   serial@10010000
> > >Err:   serial@10010000
> > >Net:   eth0: ethernet@10090000
> > >Hit any key to stop autoboot:  0
> >
> > I haven't got this "memory region" print, can you please update your U-Boot and OpenSBI
> > Repo and recheck.
>
> I have checked with latest opensbi, still got it.

Do you mean this message?

  No reserved memory region found in source FDT

If yes, you need use OpenSBI v0.7.

>
> U-Boot SPL 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36 +0530)
> Trying to boot from MMC1
>
> OpenSBI v0.6
>    ____                    _____ ____ _____
>   / __ \                  / ____|  _ \_   _|
>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
>  | |__| | |_) |  __/ | | |____) | |_) || |_
>   \____/| .__/ \___|_| |_|_____/|____/_____|
>         | |
>         |_|
>
> Platform Name          : SiFive Freedom U540
> Platform HART Features : RV64ACDFIMSU
> Platform Max HARTs     : 5
> Current Hart           : 3
> Firmware Base          : 0x80000000
> Firmware Size          : 100 KB
> Runtime SBI Version    : 0.2
>
> MIDELEG : 0x0000000000000222
> MEDELEG : 0x000000000000b109
> PMP0    : 0x0000000080000000-0x000000008001ffff (A)
> PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
>
>
> U-Boot 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36 +0530)
>
> CPU:   rv64imafdc
> Model: SiFive HiFive Unleashed A00
> DRAM:  8 GiB
> No reserved memory region found in source FDT
> MMC:   spi@10050000:mmc@0: 0
> In:    serial@10010000
> Out:   serial@10010000
> Err:   serial@10010000
> Net:   eth0: ethernet@10090000
> Hit any key to stop autoboot:  0
>
> opensbi sha1:
> 89ba63493c4ce98861144180e408d6db391fd1c3
>
> gcc version:
> gcc version 8.4.0 (Buildroot 2020.05-git-00692-gd645010af2)

Regards,
Bin
Pragnesh Patel May 20, 2020, 7:24 a.m. UTC | #8
Hi Jagan,

>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: 20 May 2020 10:07
>To: Jagan Teki <jagan@amarulasolutions.com>
>Cc: Pragnesh Patel <pragnesh.patel@sifive.com>; U-Boot-Denx <u-
>boot@lists.denx.de>; Atish Patra <atish.patra@wdc.com>; Palmer Dabbelt
><palmerdabbelt@google.com>; Paul Walmsley <paul.walmsley@sifive.com>;
>Anup Patel <anup.patel@wdc.com>; Sagar Kadam
><sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
>Dabbelt <palmer@dabbelt.com>
>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
>SPL
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>Hi Jagan,
>
>On Wed, May 20, 2020 at 12:11 AM Jagan Teki <jagan@amarulasolutions.com>
>wrote:
>>
>> On Sat, May 16, 2020 at 11:42 AM Pragnesh Patel
>> <pragnesh.patel@sifive.com> wrote:
>> >
>> > Hi Jagan,
>> >
>> > >-----Original Message-----
>> > >From: Jagan Teki <jagan@amarulasolutions.com>
>> > >Sent: 15 May 2020 23:05
>> > >To: Pragnesh Patel <pragnesh.patel@sifive.com>
>> > >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
>> > ><atish.patra@wdc.com>; Palmer Dabbelt
><palmerdabbelt@google.com>;
>> > >Bin Meng <bmeng.cn@gmail.com>; Paul Walmsley
>> > ><paul.walmsley@sifive.com>; Anup Patel <anup.patel@wdc.com>; Sagar
>> > >Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>;
>> > >Palmer Dabbelt <palmer@dabbelt.com>
>> > >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options
>> > >for U-Boot SPL
>> > >
>> > >[External Email] Do not click links or attachments unless you
>> > >recognize the sender and know the content is safe
>> > >
>> > >On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
>> > ><pragnesh.patel@sifive.com> wrote:
>> > >>
>> > >> With sifive_fu540_defconfig:
>> > >>
>> > >> User can use FSBL or u-boot-spl.bin anyone at a time.
>> > >>
>> > >> For FSBL,
>> > >> fsbl->fw_payload.bin (opensbi + U-Boot)
>> > >>
>> > >> For u-boot-spl.bin,
>> > >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>> > >>
>> > >> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin
>> > >> with
>> > >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load
>> > >> FIT image u-boot.itb from SD card into RAM.
>> > >>
>> > >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD
>> > >> card sector number (0x822) of GUID type "2E54B353-1271-4842-806F-
>> > >E436D6AF6985"
>> > >>
>> > >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
>> > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>> > >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>> > >> ---
>> > >>  configs/sifive_fu540_defconfig |   8 ++
>> > >>  doc/board/sifive/fu540.rst     | 134
>+++++++++++++++++++++++++++++++++
>> > >>  2 files changed, 142 insertions(+)
>> > >>
>> > >> diff --git a/configs/sifive_fu540_defconfig
>> > >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a
>> > >> 100644
>> > >> --- a/configs/sifive_fu540_defconfig
>> > >> +++ b/configs/sifive_fu540_defconfig
>> > >> @@ -1,6 +1,11 @@
>> > >>  CONFIG_RISCV=y
>> > >> +CONFIG_SPL_GPIO_SUPPORT=y
>> > >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>> > >>  CONFIG_ENV_SIZE=0x20000
>> > >> +CONFIG_SPL_MMC_SUPPORT=y
>> > >>  CONFIG_NR_DRAM_BANKS=1
>> > >> +CONFIG_SPL=y
>> > >> +CONFIG_SPL_SPI_SUPPORT=y
>> > >>  CONFIG_TARGET_SIFIVE_FU540=y
>> > >>  CONFIG_ARCH_RV64I=y
>> > >>  CONFIG_RISCV_SMODE=y
>> > >> @@ -9,7 +14,10 @@ CONFIG_FIT=y
>> > >>  CONFIG_MISC_INIT_R=y
>> > >>  CONFIG_DISPLAY_CPUINFO=y
>> > >>  CONFIG_DISPLAY_BOARDINFO=y
>> > >> +CONFIG_SPL_SEPARATE_BSS=y
>> > >> +CONFIG_SPL_YMODEM_SUPPORT=y
>> > >>  CONFIG_OF_BOARD_FIXUP=y
>> > >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>> > >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>> > >> +CONFIG_SPL_CLK=y
>> > >>  CONFIG_DM_MTD=y
>> > >> diff --git a/doc/board/sifive/fu540.rst
>> > >> b/doc/board/sifive/fu540.rst index 610ba87074..89e8d66c56 100644
>> > >> --- a/doc/board/sifive/fu540.rst
>> > >> +++ b/doc/board/sifive/fu540.rst
>> > >> @@ -31,6 +31,9 @@ TODO:
>> > >>          stdout-path = "/soc/serial@10010000:115200";
>> > >>     };
>> > >>
>> > >> +Booting from MMC using FSBL
>> > >> +---------------------------
>> > >> +
>> > >>  Building
>> > >>  --------
>> > >>
>> > >> @@ -421,3 +424,134 @@ as well.
>> > >>
>> > >>     Please press Enter to activate this console.
>> > >>     / #
>> > >> +
>> > >> +Booting from MMC using U-Boot SPL
>> > >> +---------------------------------
>> > >> +
>> > >> +Building
>> > >> +--------
>> > >> +
>> > >> +Before building U-Boot SPL, OpenSBI must be built first. OpenSBI
>> > >> +can be cloned and built for FU540 as below:
>> > >> +
>> > >> +.. code-block:: console
>> > >> +
>> > >> +       git clone https://github.com/riscv/opensbi.git
>> > >> +       cd opensbi
>> > >> +       make PLATFORM=generic FW_DYNAMIC=y
>> > >> +
>> > >> +Copy OpenSBI FW_DYNAMIC image
>> > >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
>> > >> +root directory
>> > >> +
>> > >> +.. code-block:: console
>> > >> +
>> > >> +       cp build/platform/generic/firmware/fw_dynamic.bin
>> > >> + <u-boot-dir>
>> > >> +
>> > >> +Now build the U-Boot SPL and U-Boot proper
>> > >> +
>> > >> +.. code-block:: console
>> > >> +
>> > >> +       cd <U-Boot-dir>
>> > >> +       make sifive_fu540_defconfig
>> > >> +       make
>> > >> +
>> > >> +This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
>> > >> +
>> > >> +
>> > >> +Flashing
>> > >> +--------
>> > >> +
>> > >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with
>> > >> +GUID type
>> > >> +5B193300-FC78-40CD-8002-E86C45580B47
>> > >> +
>> > >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a
>> > >> +partition with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
>> > >> +
>> > >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
>> > >> +u-boot-nodtb.bin and device tree blob (hifive-unleashed-a00.dtb)
>> > >> +
>> > >> +Format the SD card (make sure the disk has GPT, otherwise use
>> > >> +gdisk to switch)
>> > >> +
>> > >> +.. code-block:: none
>> > >> +
>> > >> +       # sudo sgdisk --clear \
>> > >> +       > --set-alignment=2 \
>> > >> +       > --new=1:34:2081 --change-name=1:loader1
>> > >> + --typecode=1:5B193300-
>> > >FC78-40CD-8002-E86C45580B47 \
>> > >> +       > --new=2:2082:10273 --change-name=2:loader2 --
>> > >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
>> > >> +       > --new=3:10274: --change-name=3:rootfs
>> > >> + --typecode=3:0FC63DAF-
>> > >8483-4772-8E79-3D69D8477DE4 \
>> > >> +       > /dev/sda
>> > >> +
>> > >> +Program the SD card
>> > >> +
>> > >> +.. code-block:: none
>> > >> +
>> > >> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
>> > >> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
>> > >> +
>> > >> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30
>> > >> + 2020 -
>> > >13:52:36 +0530)
>> > >> +       Trying to boot from MMC1
>> > >> +
>> > >> +
>> > >> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 -
>> > >> + 13:52:36 +0530)
>> > >> +
>> > >> +       CPU:   rv64imafdc
>> > >> +       Model: SiFive HiFive Unleashed A00
>> > >> +       DRAM:  8 GiB
>> > >> +       MMC:   spi@10050000:mmc@0: 0
>> > >> +       In:    serial@10010000
>> > >> +       Out:   serial@10010000
>> > >> +       Err:   serial@10010000
>> > >> +       Board serial number should not be 0 !!
>> > >> +       Net:
>> > >> +       Warning: ethernet@10090000 (eth0) using random MAC
>> > >> + address -
>> > >96:06:92:18:eb:04
>> > >> +       eth0: ethernet@10090000
>> > >> +       Hit any key to stop autoboot:  0
>> > >
>> > >Look like v10 seems to be a change, I can see memory region print?
>> > >
>> > >U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
>> > >+0530)
>> > >Trying to boot from MMC1
>> > >
>> > >
>> > >U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17 +0530)
>> > >
>> > >CPU:   rv64imafdc
>> > >Model: SiFive HiFive Unleashed A00
>> > >DRAM:  8 GiB
>> > >No reserved memory region found in source FDT
>> > >MMC:   spi@10050000:mmc@0: 0
>> > >In:    serial@10010000
>> > >Out:   serial@10010000
>> > >Err:   serial@10010000
>> > >Net:   eth0: ethernet@10090000
>> > >Hit any key to stop autoboot:  0
>> >
>> > I haven't got this "memory region" print, can you please update your
>> > U-Boot and OpenSBI Repo and recheck.
>>
>> I have checked with latest opensbi, still got it.
>
>Do you mean this message?
>
>  No reserved memory region found in source FDT
>
>If yes, you need use OpenSBI v0.7.
>
>>
>> U-Boot SPL 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36
>> +0530) Trying to boot from MMC1
>>
>> OpenSBI v0.6
>>    ____                    _____ ____ _____
>>   / __ \                  / ____|  _ \_   _|
>>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ | |
>> |____) | |_) || |_
>>   \____/| .__/ \___|_| |_|_____/|____/_____|
>>         | |
>>         |_|
>>
>> Platform Name          : SiFive Freedom U540
>> Platform HART Features : RV64ACDFIMSU
>> Platform Max HARTs     : 5
>> Current Hart           : 3
>> Firmware Base          : 0x80000000
>> Firmware Size          : 100 KB
>> Runtime SBI Version    : 0.2
>>
>> MIDELEG : 0x0000000000000222
>> MEDELEG : 0x000000000000b109
>> PMP0    : 0x0000000080000000-0x000000008001ffff (A)
>> PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
>>
>>
>> U-Boot 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36
>> +0530)
>>
>> CPU:   rv64imafdc
>> Model: SiFive HiFive Unleashed A00
>> DRAM:  8 GiB
>> No reserved memory region found in source FDT
>> MMC:   spi@10050000:mmc@0: 0
>> In:    serial@10010000
>> Out:   serial@10010000
>> Err:   serial@10010000
>> Net:   eth0: ethernet@10090000
>> Hit any key to stop autoboot:  0
>>
>> opensbi sha1:
>> 89ba63493c4ce98861144180e408d6db391fd1c3

I have updated my U-Boot and OpenSBI repo and recheck., still not getting this "reserved memory" print.

Below is my observation from your boot prints:
- It looks like your OpenSBI repo is not updated one. Latest OpenSBI version is v0.7 .
- you are using "make PLATFORM=sifive/fu540" instead of " make PLATFORM=generic"

Can you please rebuild OpenSBI with above suggestion and reconfirm.

U-Boot sha1:
c2279d784e35fa25ee3a9fa28a74a1ba545f8c1e
(Merge branch '2020-05-18-reduce-size-of-common.h')

OpenSBI sha1:
89ba63493c4ce98861144180e408d6db391fd1c3
(include: sbi: Add firmware extension constants)


Boot prints:

U-Boot SPL 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00 +0530)
Trying to boot from MMC1

OpenSBI v0.7-59-g89ba634
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name       : SiFive HiFive Unleashed A00
Platform Features   : timer,mfdeleg
Platform HART Count : 5
Boot HART ID        : 1
Boot HART ISA       : rv64imafdcsu
BOOT HART Features  : pmp,scounteren,mcounteren
BOOT HART PMP Count : 16
Firmware Base       : 0x80000000
Firmware Size       : 116 KB
Runtime SBI Version : 0.2

MIDELEG : 0x0000000000000222
MEDELEG : 0x000000000000b109
PMP0    : 0x0000000080000000-0x000000008001ffff (A)
PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)


U-Boot 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00 +0530)

CPU:   rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM:  8 GiB
MMC:   spi@10050000:mmc@0: 0
In:    serial@10010000
Out:   serial@10010000
Err:   serial@10010000
Board serial number should not be 0 !!
Net:
Warning: ethernet@10090000 (eth0) using random MAC address - 7a:3f:bf:c1:f9:29
eth0: ethernet@10090000
Hit any key to stop autoboot:  0
=>

>>
>> gcc version:
>> gcc version 8.4.0 (Buildroot 2020.05-git-00692-gd645010af2)
>
>Regards,
>Bin
Pragnesh Patel May 20, 2020, 1:33 p.m. UTC | #9
Hi Jagan,

>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Pragnesh Patel
>Sent: 20 May 2020 12:55
>To: Bin Meng <bmeng.cn@gmail.com>; Jagan Teki
><jagan@amarulasolutions.com>
>Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Paul
>Walmsley <paul.walmsley@sifive.com>; Anup Patel <anup.patel@wdc.com>;
>Sagar Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>;
>Palmer Dabbelt <palmer@dabbelt.com>
>Subject: RE: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
>SPL
>
>Hi Jagan,
>
>>-----Original Message-----
>>From: Bin Meng <bmeng.cn@gmail.com>
>>Sent: 20 May 2020 10:07
>>To: Jagan Teki <jagan@amarulasolutions.com>
>>Cc: Pragnesh Patel <pragnesh.patel@sifive.com>; U-Boot-Denx <u-
>>boot@lists.denx.de>; Atish Patra <atish.patra@wdc.com>; Palmer Dabbelt
>><palmerdabbelt@google.com>; Paul Walmsley
><paul.walmsley@sifive.com>;
>>Anup Patel <anup.patel@wdc.com>; Sagar Kadam
><sagar.kadam@sifive.com>;
>>Rick Chen <rick@andestech.com>; Palmer Dabbelt <palmer@dabbelt.com>
>>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for
>>U-Boot SPL
>>
>>[External Email] Do not click links or attachments unless you recognize
>>the sender and know the content is safe
>>
>>Hi Jagan,
>>
>>On Wed, May 20, 2020 at 12:11 AM Jagan Teki
>><jagan@amarulasolutions.com>
>>wrote:
>>>
>>> On Sat, May 16, 2020 at 11:42 AM Pragnesh Patel
>>> <pragnesh.patel@sifive.com> wrote:
>>> >
>>> > Hi Jagan,
>>> >
>>> > >-----Original Message-----
>>> > >From: Jagan Teki <jagan@amarulasolutions.com>
>>> > >Sent: 15 May 2020 23:05
>>> > >To: Pragnesh Patel <pragnesh.patel@sifive.com>
>>> > >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
>>> > ><atish.patra@wdc.com>; Palmer Dabbelt
>><palmerdabbelt@google.com>;
>>> > >Bin Meng <bmeng.cn@gmail.com>; Paul Walmsley
>>> > ><paul.walmsley@sifive.com>; Anup Patel <anup.patel@wdc.com>;
>Sagar
>>> > >Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>;
>>> > >Palmer Dabbelt <palmer@dabbelt.com>
>>> > >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options
>>> > >for U-Boot SPL
>>> > >
>>> > >[External Email] Do not click links or attachments unless you
>>> > >recognize the sender and know the content is safe
>>> > >
>>> > >On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
>>> > ><pragnesh.patel@sifive.com> wrote:
>>> > >>
>>> > >> With sifive_fu540_defconfig:
>>> > >>
>>> > >> User can use FSBL or u-boot-spl.bin anyone at a time.
>>> > >>
>>> > >> For FSBL,
>>> > >> fsbl->fw_payload.bin (opensbi + U-Boot)
>>> > >>
>>> > >> For u-boot-spl.bin,
>>> > >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>>> > >>
>>> > >> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin
>>> > >> with
>>> > >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load
>>> > >> FIT image u-boot.itb from SD card into RAM.
>>> > >>
>>> > >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD
>>> > >> card sector number (0x822) of GUID type
>>> > >> "2E54B353-1271-4842-806F-
>>> > >E436D6AF6985"
>>> > >>
>>> > >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
>>> > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>>> > >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>>> > >> ---
>>> > >>  configs/sifive_fu540_defconfig |   8 ++
>>> > >>  doc/board/sifive/fu540.rst     | 134
>>+++++++++++++++++++++++++++++++++
>>> > >>  2 files changed, 142 insertions(+)
>>> > >>
>>> > >> diff --git a/configs/sifive_fu540_defconfig
>>> > >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a
>>> > >> 100644
>>> > >> --- a/configs/sifive_fu540_defconfig
>>> > >> +++ b/configs/sifive_fu540_defconfig
>>> > >> @@ -1,6 +1,11 @@
>>> > >>  CONFIG_RISCV=y
>>> > >> +CONFIG_SPL_GPIO_SUPPORT=y
>>> > >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>>> > >>  CONFIG_ENV_SIZE=0x20000
>>> > >> +CONFIG_SPL_MMC_SUPPORT=y
>>> > >>  CONFIG_NR_DRAM_BANKS=1
>>> > >> +CONFIG_SPL=y
>>> > >> +CONFIG_SPL_SPI_SUPPORT=y
>>> > >>  CONFIG_TARGET_SIFIVE_FU540=y
>>> > >>  CONFIG_ARCH_RV64I=y
>>> > >>  CONFIG_RISCV_SMODE=y
>>> > >> @@ -9,7 +14,10 @@ CONFIG_FIT=y
>>> > >>  CONFIG_MISC_INIT_R=y
>>> > >>  CONFIG_DISPLAY_CPUINFO=y
>>> > >>  CONFIG_DISPLAY_BOARDINFO=y
>>> > >> +CONFIG_SPL_SEPARATE_BSS=y
>>> > >> +CONFIG_SPL_YMODEM_SUPPORT=y
>>> > >>  CONFIG_OF_BOARD_FIXUP=y
>>> > >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>>> > >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>>> > >> +CONFIG_SPL_CLK=y
>>> > >>  CONFIG_DM_MTD=y
>>> > >> diff --git a/doc/board/sifive/fu540.rst
>>> > >> b/doc/board/sifive/fu540.rst index 610ba87074..89e8d66c56 100644
>>> > >> --- a/doc/board/sifive/fu540.rst
>>> > >> +++ b/doc/board/sifive/fu540.rst
>>> > >> @@ -31,6 +31,9 @@ TODO:
>>> > >>          stdout-path = "/soc/serial@10010000:115200";
>>> > >>     };
>>> > >>
>>> > >> +Booting from MMC using FSBL
>>> > >> +---------------------------
>>> > >> +
>>> > >>  Building
>>> > >>  --------
>>> > >>
>>> > >> @@ -421,3 +424,134 @@ as well.
>>> > >>
>>> > >>     Please press Enter to activate this console.
>>> > >>     / #
>>> > >> +
>>> > >> +Booting from MMC using U-Boot SPL
>>> > >> +---------------------------------
>>> > >> +
>>> > >> +Building
>>> > >> +--------
>>> > >> +
>>> > >> +Before building U-Boot SPL, OpenSBI must be built first.
>>> > >> +OpenSBI can be cloned and built for FU540 as below:
>>> > >> +
>>> > >> +.. code-block:: console
>>> > >> +
>>> > >> +       git clone https://github.com/riscv/opensbi.git
>>> > >> +       cd opensbi
>>> > >> +       make PLATFORM=generic FW_DYNAMIC=y
>>> > >> +
>>> > >> +Copy OpenSBI FW_DYNAMIC image
>>> > >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
>>> > >> +root directory
>>> > >> +
>>> > >> +.. code-block:: console
>>> > >> +
>>> > >> +       cp build/platform/generic/firmware/fw_dynamic.bin
>>> > >> + <u-boot-dir>
>>> > >> +
>>> > >> +Now build the U-Boot SPL and U-Boot proper
>>> > >> +
>>> > >> +.. code-block:: console
>>> > >> +
>>> > >> +       cd <U-Boot-dir>
>>> > >> +       make sifive_fu540_defconfig
>>> > >> +       make
>>> > >> +
>>> > >> +This will generate spl/u-boot-spl.bin and FIT image
>>> > >> +(u-boot.itb)
>>> > >> +
>>> > >> +
>>> > >> +Flashing
>>> > >> +--------
>>> > >> +
>>> > >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition
>>> > >> +with GUID type
>>> > >> +5B193300-FC78-40CD-8002-E86C45580B47
>>> > >> +
>>> > >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a
>>> > >> +partition with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
>>> > >> +
>>> > >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
>>> > >> +u-boot-nodtb.bin and device tree blob
>>> > >> +(hifive-unleashed-a00.dtb)
>>> > >> +
>>> > >> +Format the SD card (make sure the disk has GPT, otherwise use
>>> > >> +gdisk to switch)
>>> > >> +
>>> > >> +.. code-block:: none
>>> > >> +
>>> > >> +       # sudo sgdisk --clear \
>>> > >> +       > --set-alignment=2 \
>>> > >> +       > --new=1:34:2081 --change-name=1:loader1
>>> > >> + --typecode=1:5B193300-
>>> > >FC78-40CD-8002-E86C45580B47 \
>>> > >> +       > --new=2:2082:10273 --change-name=2:loader2 --
>>> > >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
>>> > >> +       > --new=3:10274: --change-name=3:rootfs
>>> > >> + --typecode=3:0FC63DAF-
>>> > >8483-4772-8E79-3D69D8477DE4 \
>>> > >> +       > /dev/sda
>>> > >> +
>>> > >> +Program the SD card
>>> > >> +
>>> > >> +.. code-block:: none
>>> > >> +
>>> > >> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
>>> > >> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
>>> > >> +
>>> > >> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30
>>> > >> + 2020 -
>>> > >13:52:36 +0530)
>>> > >> +       Trying to boot from MMC1
>>> > >> +
>>> > >> +
>>> > >> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020
>>> > >> + -
>>> > >> + 13:52:36 +0530)
>>> > >> +
>>> > >> +       CPU:   rv64imafdc
>>> > >> +       Model: SiFive HiFive Unleashed A00
>>> > >> +       DRAM:  8 GiB
>>> > >> +       MMC:   spi@10050000:mmc@0: 0
>>> > >> +       In:    serial@10010000
>>> > >> +       Out:   serial@10010000
>>> > >> +       Err:   serial@10010000
>>> > >> +       Board serial number should not be 0 !!
>>> > >> +       Net:
>>> > >> +       Warning: ethernet@10090000 (eth0) using random MAC
>>> > >> + address -
>>> > >96:06:92:18:eb:04
>>> > >> +       eth0: ethernet@10090000
>>> > >> +       Hit any key to stop autoboot:  0
>>> > >
>>> > >Look like v10 seems to be a change, I can see memory region print?
>>> > >
>>> > >U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
>>> > >+0530)
>>> > >Trying to boot from MMC1
>>> > >
>>> > >
>>> > >U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
>>> > >+0530)
>>> > >
>>> > >CPU:   rv64imafdc
>>> > >Model: SiFive HiFive Unleashed A00
>>> > >DRAM:  8 GiB
>>> > >No reserved memory region found in source FDT
>>> > >MMC:   spi@10050000:mmc@0: 0
>>> > >In:    serial@10010000
>>> > >Out:   serial@10010000
>>> > >Err:   serial@10010000
>>> > >Net:   eth0: ethernet@10090000
>>> > >Hit any key to stop autoboot:  0
>>> >
>>> > I haven't got this "memory region" print, can you please update
>>> > your U-Boot and OpenSBI Repo and recheck.
>>>
>>> I have checked with latest opensbi, still got it.
>>
>>Do you mean this message?
>>
>>  No reserved memory region found in source FDT
>>
>>If yes, you need use OpenSBI v0.7.
>>
>>>
>>> U-Boot SPL 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 -
>>> 21:33:36
>>> +0530) Trying to boot from MMC1
>>>
>>> OpenSBI v0.6
>>>    ____                    _____ ____ _____
>>>   / __ \                  / ____|  _ \_   _|
>>>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>>>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ | |
>>> |____) | |_) || |_
>>>   \____/| .__/ \___|_| |_|_____/|____/_____|
>>>         | |
>>>         |_|
>>>
>>> Platform Name          : SiFive Freedom U540
>>> Platform HART Features : RV64ACDFIMSU
>>> Platform Max HARTs     : 5
>>> Current Hart           : 3
>>> Firmware Base          : 0x80000000
>>> Firmware Size          : 100 KB
>>> Runtime SBI Version    : 0.2
>>>
>>> MIDELEG : 0x0000000000000222
>>> MEDELEG : 0x000000000000b109
>>> PMP0    : 0x0000000080000000-0x000000008001ffff (A)
>>> PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
>>>
>>>
>>> U-Boot 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36
>>> +0530)
>>>
>>> CPU:   rv64imafdc
>>> Model: SiFive HiFive Unleashed A00
>>> DRAM:  8 GiB
>>> No reserved memory region found in source FDT
>>> MMC:   spi@10050000:mmc@0: 0
>>> In:    serial@10010000
>>> Out:   serial@10010000
>>> Err:   serial@10010000
>>> Net:   eth0: ethernet@10090000
>>> Hit any key to stop autoboot:  0
>>>
>>> opensbi sha1:
>>> 89ba63493c4ce98861144180e408d6db391fd1c3
>
>I have updated my U-Boot and OpenSBI repo and recheck., still not getting
>this "reserved memory" print.
>
>Below is my observation from your boot prints:
>- It looks like your OpenSBI repo is not updated one. Latest OpenSBI version is
>v0.7 .
>- you are using "make PLATFORM=sifive/fu540" instead of " make
>PLATFORM=generic"
>
>Can you please rebuild OpenSBI with above suggestion and reconfirm.
>
>U-Boot sha1:
>c2279d784e35fa25ee3a9fa28a74a1ba545f8c1e
>(Merge branch '2020-05-18-reduce-size-of-common.h')
>
>OpenSBI sha1:
>89ba63493c4ce98861144180e408d6db391fd1c3
>(include: sbi: Add firmware extension constants)
>
>
>Boot prints:
>
>U-Boot SPL 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00
>+0530) Trying to boot from MMC1
>
>OpenSBI v0.7-59-g89ba634
>   ____                    _____ ____ _____
>  / __ \                  / ____|  _ \_   _|
> | |  | |_ __   ___ _ __ | (___ | |_) || |
> | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ | | |____) | |_) || |_
>  \____/| .__/ \___|_| |_|_____/|____/_____|
>        | |
>        |_|
>
>Platform Name       : SiFive HiFive Unleashed A00
>Platform Features   : timer,mfdeleg
>Platform HART Count : 5
>Boot HART ID        : 1
>Boot HART ISA       : rv64imafdcsu
>BOOT HART Features  : pmp,scounteren,mcounteren BOOT HART PMP Count :
>16
>Firmware Base       : 0x80000000
>Firmware Size       : 116 KB
>Runtime SBI Version : 0.2
>
>MIDELEG : 0x0000000000000222
>MEDELEG : 0x000000000000b109
>PMP0    : 0x0000000080000000-0x000000008001ffff (A)
>PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
>
>
>U-Boot 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00 +0530)
>
>CPU:   rv64imafdc
>Model: SiFive HiFive Unleashed A00
>DRAM:  8 GiB
>MMC:   spi@10050000:mmc@0: 0
>In:    serial@10010000
>Out:   serial@10010000
>Err:   serial@10010000
>Board serial number should not be 0 !!
>Net:
>Warning: ethernet@10090000 (eth0) using random MAC address -
>7a:3f:bf:c1:f9:29
>eth0: ethernet@10090000
>Hit any key to stop autoboot:  0
>=>

Any comments ? I am planning to send v12.

>
>>>
>>> gcc version:
>>> gcc version 8.4.0 (Buildroot 2020.05-git-00692-gd645010af2)
>>
>>Regards,
>>Bin
Bin Meng May 20, 2020, 1:43 p.m. UTC | #10
Hi Pragnesh,

On Wed, May 20, 2020 at 9:33 PM Pragnesh Patel
<pragnesh.patel@sifive.com> wrote:
>
> Hi Jagan,
>
> >-----Original Message-----
> >From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Pragnesh Patel
> >Sent: 20 May 2020 12:55
> >To: Bin Meng <bmeng.cn@gmail.com>; Jagan Teki
> ><jagan@amarulasolutions.com>
> >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
> ><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>; Paul
> >Walmsley <paul.walmsley@sifive.com>; Anup Patel <anup.patel@wdc.com>;
> >Sagar Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>;
> >Palmer Dabbelt <palmer@dabbelt.com>
> >Subject: RE: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
> >SPL
> >
> >Hi Jagan,
> >
> >>-----Original Message-----
> >>From: Bin Meng <bmeng.cn@gmail.com>
> >>Sent: 20 May 2020 10:07
> >>To: Jagan Teki <jagan@amarulasolutions.com>
> >>Cc: Pragnesh Patel <pragnesh.patel@sifive.com>; U-Boot-Denx <u-
> >>boot@lists.denx.de>; Atish Patra <atish.patra@wdc.com>; Palmer Dabbelt
> >><palmerdabbelt@google.com>; Paul Walmsley
> ><paul.walmsley@sifive.com>;
> >>Anup Patel <anup.patel@wdc.com>; Sagar Kadam
> ><sagar.kadam@sifive.com>;
> >>Rick Chen <rick@andestech.com>; Palmer Dabbelt <palmer@dabbelt.com>
> >>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for
> >>U-Boot SPL
> >>
> >>[External Email] Do not click links or attachments unless you recognize
> >>the sender and know the content is safe
> >>
> >>Hi Jagan,
> >>
> >>On Wed, May 20, 2020 at 12:11 AM Jagan Teki
> >><jagan@amarulasolutions.com>
> >>wrote:
> >>>
> >>> On Sat, May 16, 2020 at 11:42 AM Pragnesh Patel
> >>> <pragnesh.patel@sifive.com> wrote:
> >>> >
> >>> > Hi Jagan,
> >>> >
> >>> > >-----Original Message-----
> >>> > >From: Jagan Teki <jagan@amarulasolutions.com>
> >>> > >Sent: 15 May 2020 23:05
> >>> > >To: Pragnesh Patel <pragnesh.patel@sifive.com>
> >>> > >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
> >>> > ><atish.patra@wdc.com>; Palmer Dabbelt
> >><palmerdabbelt@google.com>;
> >>> > >Bin Meng <bmeng.cn@gmail.com>; Paul Walmsley
> >>> > ><paul.walmsley@sifive.com>; Anup Patel <anup.patel@wdc.com>;
> >Sagar
> >>> > >Kadam <sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>;
> >>> > >Palmer Dabbelt <palmer@dabbelt.com>
> >>> > >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options
> >>> > >for U-Boot SPL
> >>> > >
> >>> > >[External Email] Do not click links or attachments unless you
> >>> > >recognize the sender and know the content is safe
> >>> > >
> >>> > >On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
> >>> > ><pragnesh.patel@sifive.com> wrote:
> >>> > >>
> >>> > >> With sifive_fu540_defconfig:
> >>> > >>
> >>> > >> User can use FSBL or u-boot-spl.bin anyone at a time.
> >>> > >>
> >>> > >> For FSBL,
> >>> > >> fsbl->fw_payload.bin (opensbi + U-Boot)
> >>> > >>
> >>> > >> For u-boot-spl.bin,
> >>> > >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
> >>> > >>
> >>> > >> U-Boot SPL will be loaded by ZSBL from SD card (replace fsbl.bin
> >>> > >> with
> >>> > >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then load
> >>> > >> FIT image u-boot.itb from SD card into RAM.
> >>> > >>
> >>> > >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD
> >>> > >> card sector number (0x822) of GUID type
> >>> > >> "2E54B353-1271-4842-806F-
> >>> > >E436D6AF6985"
> >>> > >>
> >>> > >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
> >>> > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> >>> > >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
> >>> > >> ---
> >>> > >>  configs/sifive_fu540_defconfig |   8 ++
> >>> > >>  doc/board/sifive/fu540.rst     | 134
> >>+++++++++++++++++++++++++++++++++
> >>> > >>  2 files changed, 142 insertions(+)
> >>> > >>
> >>> > >> diff --git a/configs/sifive_fu540_defconfig
> >>> > >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a
> >>> > >> 100644
> >>> > >> --- a/configs/sifive_fu540_defconfig
> >>> > >> +++ b/configs/sifive_fu540_defconfig
> >>> > >> @@ -1,6 +1,11 @@
> >>> > >>  CONFIG_RISCV=y
> >>> > >> +CONFIG_SPL_GPIO_SUPPORT=y
> >>> > >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
> >>> > >>  CONFIG_ENV_SIZE=0x20000
> >>> > >> +CONFIG_SPL_MMC_SUPPORT=y
> >>> > >>  CONFIG_NR_DRAM_BANKS=1
> >>> > >> +CONFIG_SPL=y
> >>> > >> +CONFIG_SPL_SPI_SUPPORT=y
> >>> > >>  CONFIG_TARGET_SIFIVE_FU540=y
> >>> > >>  CONFIG_ARCH_RV64I=y
> >>> > >>  CONFIG_RISCV_SMODE=y
> >>> > >> @@ -9,7 +14,10 @@ CONFIG_FIT=y
> >>> > >>  CONFIG_MISC_INIT_R=y
> >>> > >>  CONFIG_DISPLAY_CPUINFO=y
> >>> > >>  CONFIG_DISPLAY_BOARDINFO=y
> >>> > >> +CONFIG_SPL_SEPARATE_BSS=y
> >>> > >> +CONFIG_SPL_YMODEM_SUPPORT=y
> >>> > >>  CONFIG_OF_BOARD_FIXUP=y
> >>> > >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
> >>> > >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
> >>> > >> +CONFIG_SPL_CLK=y
> >>> > >>  CONFIG_DM_MTD=y
> >>> > >> diff --git a/doc/board/sifive/fu540.rst
> >>> > >> b/doc/board/sifive/fu540.rst index 610ba87074..89e8d66c56 100644
> >>> > >> --- a/doc/board/sifive/fu540.rst
> >>> > >> +++ b/doc/board/sifive/fu540.rst
> >>> > >> @@ -31,6 +31,9 @@ TODO:
> >>> > >>          stdout-path = "/soc/serial@10010000:115200";
> >>> > >>     };
> >>> > >>
> >>> > >> +Booting from MMC using FSBL
> >>> > >> +---------------------------
> >>> > >> +
> >>> > >>  Building
> >>> > >>  --------
> >>> > >>
> >>> > >> @@ -421,3 +424,134 @@ as well.
> >>> > >>
> >>> > >>     Please press Enter to activate this console.
> >>> > >>     / #
> >>> > >> +
> >>> > >> +Booting from MMC using U-Boot SPL
> >>> > >> +---------------------------------
> >>> > >> +
> >>> > >> +Building
> >>> > >> +--------
> >>> > >> +
> >>> > >> +Before building U-Boot SPL, OpenSBI must be built first.
> >>> > >> +OpenSBI can be cloned and built for FU540 as below:
> >>> > >> +
> >>> > >> +.. code-block:: console
> >>> > >> +
> >>> > >> +       git clone https://github.com/riscv/opensbi.git
> >>> > >> +       cd opensbi
> >>> > >> +       make PLATFORM=generic FW_DYNAMIC=y
> >>> > >> +
> >>> > >> +Copy OpenSBI FW_DYNAMIC image
> >>> > >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
> >>> > >> +root directory
> >>> > >> +
> >>> > >> +.. code-block:: console
> >>> > >> +
> >>> > >> +       cp build/platform/generic/firmware/fw_dynamic.bin
> >>> > >> + <u-boot-dir>
> >>> > >> +
> >>> > >> +Now build the U-Boot SPL and U-Boot proper
> >>> > >> +
> >>> > >> +.. code-block:: console
> >>> > >> +
> >>> > >> +       cd <U-Boot-dir>
> >>> > >> +       make sifive_fu540_defconfig
> >>> > >> +       make
> >>> > >> +
> >>> > >> +This will generate spl/u-boot-spl.bin and FIT image
> >>> > >> +(u-boot.itb)
> >>> > >> +
> >>> > >> +
> >>> > >> +Flashing
> >>> > >> +--------
> >>> > >> +
> >>> > >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition
> >>> > >> +with GUID type
> >>> > >> +5B193300-FC78-40CD-8002-E86C45580B47
> >>> > >> +
> >>> > >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a
> >>> > >> +partition with GUID type 2E54B353-1271-4842-806F-E436D6AF6985
> >>> > >> +
> >>> > >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
> >>> > >> +u-boot-nodtb.bin and device tree blob
> >>> > >> +(hifive-unleashed-a00.dtb)
> >>> > >> +
> >>> > >> +Format the SD card (make sure the disk has GPT, otherwise use
> >>> > >> +gdisk to switch)
> >>> > >> +
> >>> > >> +.. code-block:: none
> >>> > >> +
> >>> > >> +       # sudo sgdisk --clear \
> >>> > >> +       > --set-alignment=2 \
> >>> > >> +       > --new=1:34:2081 --change-name=1:loader1
> >>> > >> + --typecode=1:5B193300-
> >>> > >FC78-40CD-8002-E86C45580B47 \
> >>> > >> +       > --new=2:2082:10273 --change-name=2:loader2 --
> >>> > >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
> >>> > >> +       > --new=3:10274: --change-name=3:rootfs
> >>> > >> + --typecode=3:0FC63DAF-
> >>> > >8483-4772-8E79-3D69D8477DE4 \
> >>> > >> +       > /dev/sda
> >>> > >> +
> >>> > >> +Program the SD card
> >>> > >> +
> >>> > >> +.. code-block:: none
> >>> > >> +
> >>> > >> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
> >>> > >> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
> >>> > >> +
> >>> > >> +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.04-rc2-00109-g63efc7e07e-dirty (Apr 30
> >>> > >> + 2020 -
> >>> > >13:52:36 +0530)
> >>> > >> +       Trying to boot from MMC1
> >>> > >> +
> >>> > >> +
> >>> > >> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020
> >>> > >> + -
> >>> > >> + 13:52:36 +0530)
> >>> > >> +
> >>> > >> +       CPU:   rv64imafdc
> >>> > >> +       Model: SiFive HiFive Unleashed A00
> >>> > >> +       DRAM:  8 GiB
> >>> > >> +       MMC:   spi@10050000:mmc@0: 0
> >>> > >> +       In:    serial@10010000
> >>> > >> +       Out:   serial@10010000
> >>> > >> +       Err:   serial@10010000
> >>> > >> +       Board serial number should not be 0 !!
> >>> > >> +       Net:
> >>> > >> +       Warning: ethernet@10090000 (eth0) using random MAC
> >>> > >> + address -
> >>> > >96:06:92:18:eb:04
> >>> > >> +       eth0: ethernet@10090000
> >>> > >> +       Hit any key to stop autoboot:  0
> >>> > >
> >>> > >Look like v10 seems to be a change, I can see memory region print?
> >>> > >
> >>> > >U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
> >>> > >+0530)
> >>> > >Trying to boot from MMC1
> >>> > >
> >>> > >
> >>> > >U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
> >>> > >+0530)
> >>> > >
> >>> > >CPU:   rv64imafdc
> >>> > >Model: SiFive HiFive Unleashed A00
> >>> > >DRAM:  8 GiB
> >>> > >No reserved memory region found in source FDT
> >>> > >MMC:   spi@10050000:mmc@0: 0
> >>> > >In:    serial@10010000
> >>> > >Out:   serial@10010000
> >>> > >Err:   serial@10010000
> >>> > >Net:   eth0: ethernet@10090000
> >>> > >Hit any key to stop autoboot:  0
> >>> >
> >>> > I haven't got this "memory region" print, can you please update
> >>> > your U-Boot and OpenSBI Repo and recheck.
> >>>
> >>> I have checked with latest opensbi, still got it.
> >>
> >>Do you mean this message?
> >>
> >>  No reserved memory region found in source FDT
> >>
> >>If yes, you need use OpenSBI v0.7.
> >>
> >>>
> >>> U-Boot SPL 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 -
> >>> 21:33:36
> >>> +0530) Trying to boot from MMC1
> >>>
> >>> OpenSBI v0.6
> >>>    ____                    _____ ____ _____
> >>>   / __ \                  / ____|  _ \_   _|
> >>>  | |  | |_ __   ___ _ __ | (___ | |_) || |
> >>>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ | |
> >>> |____) | |_) || |_
> >>>   \____/| .__/ \___|_| |_|_____/|____/_____|
> >>>         | |
> >>>         |_|
> >>>
> >>> Platform Name          : SiFive Freedom U540
> >>> Platform HART Features : RV64ACDFIMSU
> >>> Platform Max HARTs     : 5
> >>> Current Hart           : 3
> >>> Firmware Base          : 0x80000000
> >>> Firmware Size          : 100 KB
> >>> Runtime SBI Version    : 0.2
> >>>
> >>> MIDELEG : 0x0000000000000222
> >>> MEDELEG : 0x000000000000b109
> >>> PMP0    : 0x0000000080000000-0x000000008001ffff (A)
> >>> PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
> >>>
> >>>
> >>> U-Boot 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36
> >>> +0530)
> >>>
> >>> CPU:   rv64imafdc
> >>> Model: SiFive HiFive Unleashed A00
> >>> DRAM:  8 GiB
> >>> No reserved memory region found in source FDT
> >>> MMC:   spi@10050000:mmc@0: 0
> >>> In:    serial@10010000
> >>> Out:   serial@10010000
> >>> Err:   serial@10010000
> >>> Net:   eth0: ethernet@10090000
> >>> Hit any key to stop autoboot:  0
> >>>
> >>> opensbi sha1:
> >>> 89ba63493c4ce98861144180e408d6db391fd1c3
> >
> >I have updated my U-Boot and OpenSBI repo and recheck., still not getting
> >this "reserved memory" print.
> >
> >Below is my observation from your boot prints:
> >- It looks like your OpenSBI repo is not updated one. Latest OpenSBI version is
> >v0.7 .
> >- you are using "make PLATFORM=sifive/fu540" instead of " make
> >PLATFORM=generic"
> >
> >Can you please rebuild OpenSBI with above suggestion and reconfirm.
> >
> >U-Boot sha1:
> >c2279d784e35fa25ee3a9fa28a74a1ba545f8c1e
> >(Merge branch '2020-05-18-reduce-size-of-common.h')
> >
> >OpenSBI sha1:
> >89ba63493c4ce98861144180e408d6db391fd1c3
> >(include: sbi: Add firmware extension constants)
> >
> >
> >Boot prints:
> >
> >U-Boot SPL 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00
> >+0530) Trying to boot from MMC1
> >
> >OpenSBI v0.7-59-g89ba634
> >   ____                    _____ ____ _____
> >  / __ \                  / ____|  _ \_   _|
> > | |  | |_ __   ___ _ __ | (___ | |_) || |
> > | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ | | |____) | |_) || |_
> >  \____/| .__/ \___|_| |_|_____/|____/_____|
> >        | |
> >        |_|
> >
> >Platform Name       : SiFive HiFive Unleashed A00
> >Platform Features   : timer,mfdeleg
> >Platform HART Count : 5
> >Boot HART ID        : 1
> >Boot HART ISA       : rv64imafdcsu
> >BOOT HART Features  : pmp,scounteren,mcounteren BOOT HART PMP Count :
> >16
> >Firmware Base       : 0x80000000
> >Firmware Size       : 116 KB
> >Runtime SBI Version : 0.2
> >
> >MIDELEG : 0x0000000000000222
> >MEDELEG : 0x000000000000b109
> >PMP0    : 0x0000000080000000-0x000000008001ffff (A)
> >PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
> >
> >
> >U-Boot 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00 +0530)
> >
> >CPU:   rv64imafdc
> >Model: SiFive HiFive Unleashed A00
> >DRAM:  8 GiB
> >MMC:   spi@10050000:mmc@0: 0
> >In:    serial@10010000
> >Out:   serial@10010000
> >Err:   serial@10010000
> >Board serial number should not be 0 !!
> >Net:
> >Warning: ethernet@10090000 (eth0) using random MAC address -
> >7a:3f:bf:c1:f9:29
> >eth0: ethernet@10090000
> >Hit any key to stop autoboot:  0
> >=>
>
> Any comments ? I am planning to send v12.

I did not see that. But I see your log has

> >Warning: ethernet@10090000 (eth0) using random MAC address - 7a:3f:bf:c1:f9:29

and I did not see that. This means that OTP driver does not work on your board?

Regards,
Bin
Pragnesh Patel May 20, 2020, 1:51 p.m. UTC | #11
Hi Bin,

>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: 20 May 2020 19:14
>To: Pragnesh Patel <pragnesh.patel@sifive.com>
>Cc: Jagan Teki <jagan@amarulasolutions.com>; U-Boot-Denx <u-
>boot@lists.denx.de>; Atish Patra <atish.patra@wdc.com>; Palmer Dabbelt
><palmerdabbelt@google.com>; Paul Walmsley <paul.walmsley@sifive.com>;
>Anup Patel <anup.patel@wdc.com>; Sagar Kadam
><sagar.kadam@sifive.com>; Rick Chen <rick@andestech.com>; Palmer
>Dabbelt <palmer@dabbelt.com>
>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options for U-Boot
>SPL
>
>[External Email] Do not click links or attachments unless you recognize the
>sender and know the content is safe
>
>Hi Pragnesh,
>
>On Wed, May 20, 2020 at 9:33 PM Pragnesh Patel
><pragnesh.patel@sifive.com> wrote:
>>
>> Hi Jagan,
>>
>> >-----Original Message-----
>> >From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Pragnesh
>> >Patel
>> >Sent: 20 May 2020 12:55
>> >To: Bin Meng <bmeng.cn@gmail.com>; Jagan Teki
>> ><jagan@amarulasolutions.com>
>> >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
>> ><atish.patra@wdc.com>; Palmer Dabbelt <palmerdabbelt@google.com>;
>> >Paul Walmsley <paul.walmsley@sifive.com>; Anup Patel
>> ><anup.patel@wdc.com>; Sagar Kadam <sagar.kadam@sifive.com>; Rick
>Chen
>> ><rick@andestech.com>; Palmer Dabbelt <palmer@dabbelt.com>
>> >Subject: RE: [PATCH v10 17/18] configs: fu540: Add config options for
>> >U-Boot SPL
>> >
>> >Hi Jagan,
>> >
>> >>-----Original Message-----
>> >>From: Bin Meng <bmeng.cn@gmail.com>
>> >>Sent: 20 May 2020 10:07
>> >>To: Jagan Teki <jagan@amarulasolutions.com>
>> >>Cc: Pragnesh Patel <pragnesh.patel@sifive.com>; U-Boot-Denx <u-
>> >>boot@lists.denx.de>; Atish Patra <atish.patra@wdc.com>; Palmer
>> >>Dabbelt <palmerdabbelt@google.com>; Paul Walmsley
>> ><paul.walmsley@sifive.com>;
>> >>Anup Patel <anup.patel@wdc.com>; Sagar Kadam
>> ><sagar.kadam@sifive.com>;
>> >>Rick Chen <rick@andestech.com>; Palmer Dabbelt
><palmer@dabbelt.com>
>> >>Subject: Re: [PATCH v10 17/18] configs: fu540: Add config options
>> >>for U-Boot SPL
>> >>
>> >>[External Email] Do not click links or attachments unless you
>> >>recognize the sender and know the content is safe
>> >>
>> >>Hi Jagan,
>> >>
>> >>On Wed, May 20, 2020 at 12:11 AM Jagan Teki
>> >><jagan@amarulasolutions.com>
>> >>wrote:
>> >>>
>> >>> On Sat, May 16, 2020 at 11:42 AM Pragnesh Patel
>> >>> <pragnesh.patel@sifive.com> wrote:
>> >>> >
>> >>> > Hi Jagan,
>> >>> >
>> >>> > >-----Original Message-----
>> >>> > >From: Jagan Teki <jagan@amarulasolutions.com>
>> >>> > >Sent: 15 May 2020 23:05
>> >>> > >To: Pragnesh Patel <pragnesh.patel@sifive.com>
>> >>> > >Cc: U-Boot-Denx <u-boot@lists.denx.de>; Atish Patra
>> >>> > ><atish.patra@wdc.com>; Palmer Dabbelt
>> >><palmerdabbelt@google.com>;
>> >>> > >Bin Meng <bmeng.cn@gmail.com>; Paul Walmsley
>> >>> > ><paul.walmsley@sifive.com>; Anup Patel <anup.patel@wdc.com>;
>> >Sagar
>> >>> > >Kadam <sagar.kadam@sifive.com>; Rick Chen
><rick@andestech.com>;
>> >>> > >Palmer Dabbelt <palmer@dabbelt.com>
>> >>> > >Subject: Re: [PATCH v10 17/18] configs: fu540: Add config
>> >>> > >options for U-Boot SPL
>> >>> > >
>> >>> > >[External Email] Do not click links or attachments unless you
>> >>> > >recognize the sender and know the content is safe
>> >>> > >
>> >>> > >On Thu, May 14, 2020 at 5:24 PM Pragnesh Patel
>> >>> > ><pragnesh.patel@sifive.com> wrote:
>> >>> > >>
>> >>> > >> With sifive_fu540_defconfig:
>> >>> > >>
>> >>> > >> User can use FSBL or u-boot-spl.bin anyone at a time.
>> >>> > >>
>> >>> > >> For FSBL,
>> >>> > >> fsbl->fw_payload.bin (opensbi + U-Boot)
>> >>> > >>
>> >>> > >> For u-boot-spl.bin,
>> >>> > >> u-boot-spl.bin->FIT image (opensbi + U-Boot proper + dtb)
>> >>> > >>
>> >>> > >> U-Boot SPL will be loaded by ZSBL from SD card (replace
>> >>> > >> fsbl.bin with
>> >>> > >> u-boot-spl.bin) and runs in L2 LIM in machine mode and then
>> >>> > >> load FIT image u-boot.itb from SD card into RAM.
>> >>> > >>
>> >>> > >> U-Boot SPL expects u-boot.itb FIT image at the starting of SD
>> >>> > >> card sector number (0x822) of GUID type
>> >>> > >> "2E54B353-1271-4842-806F-
>> >>> > >E436D6AF6985"
>> >>> > >>
>> >>> > >> Signed-off-by: Pragnesh Patel <pragnesh.patel@sifive.com>
>> >>> > >> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
>> >>> > >> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
>> >>> > >> ---
>> >>> > >>  configs/sifive_fu540_defconfig |   8 ++
>> >>> > >>  doc/board/sifive/fu540.rst     | 134
>> >>+++++++++++++++++++++++++++++++++
>> >>> > >>  2 files changed, 142 insertions(+)
>> >>> > >>
>> >>> > >> diff --git a/configs/sifive_fu540_defconfig
>> >>> > >> b/configs/sifive_fu540_defconfig index f805aacc7a..8d412f8d6a
>> >>> > >> 100644
>> >>> > >> --- a/configs/sifive_fu540_defconfig
>> >>> > >> +++ b/configs/sifive_fu540_defconfig
>> >>> > >> @@ -1,6 +1,11 @@
>> >>> > >>  CONFIG_RISCV=y
>> >>> > >> +CONFIG_SPL_GPIO_SUPPORT=y
>> >>> > >> +CONFIG_SYS_MALLOC_F_LEN=0x3000
>> >>> > >>  CONFIG_ENV_SIZE=0x20000
>> >>> > >> +CONFIG_SPL_MMC_SUPPORT=y
>> >>> > >>  CONFIG_NR_DRAM_BANKS=1
>> >>> > >> +CONFIG_SPL=y
>> >>> > >> +CONFIG_SPL_SPI_SUPPORT=y
>> >>> > >>  CONFIG_TARGET_SIFIVE_FU540=y  CONFIG_ARCH_RV64I=y
>> >>> > >> CONFIG_RISCV_SMODE=y @@ -9,7 +14,10 @@ CONFIG_FIT=y
>> >>> > >> CONFIG_MISC_INIT_R=y  CONFIG_DISPLAY_CPUINFO=y
>> >>> > >> CONFIG_DISPLAY_BOARDINFO=y
>> >>> > >> +CONFIG_SPL_SEPARATE_BSS=y
>> >>> > >> +CONFIG_SPL_YMODEM_SUPPORT=y
>> >>> > >>  CONFIG_OF_BOARD_FIXUP=y
>> >>> > >>  CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
>> >>> > >>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>> >>> > >> +CONFIG_SPL_CLK=y
>> >>> > >>  CONFIG_DM_MTD=y
>> >>> > >> diff --git a/doc/board/sifive/fu540.rst
>> >>> > >> b/doc/board/sifive/fu540.rst index 610ba87074..89e8d66c56
>> >>> > >> 100644
>> >>> > >> --- a/doc/board/sifive/fu540.rst
>> >>> > >> +++ b/doc/board/sifive/fu540.rst
>> >>> > >> @@ -31,6 +31,9 @@ TODO:
>> >>> > >>          stdout-path = "/soc/serial@10010000:115200";
>> >>> > >>     };
>> >>> > >>
>> >>> > >> +Booting from MMC using FSBL
>> >>> > >> +---------------------------
>> >>> > >> +
>> >>> > >>  Building
>> >>> > >>  --------
>> >>> > >>
>> >>> > >> @@ -421,3 +424,134 @@ as well.
>> >>> > >>
>> >>> > >>     Please press Enter to activate this console.
>> >>> > >>     / #
>> >>> > >> +
>> >>> > >> +Booting from MMC using U-Boot SPL
>> >>> > >> +---------------------------------
>> >>> > >> +
>> >>> > >> +Building
>> >>> > >> +--------
>> >>> > >> +
>> >>> > >> +Before building U-Boot SPL, OpenSBI must be built first.
>> >>> > >> +OpenSBI can be cloned and built for FU540 as below:
>> >>> > >> +
>> >>> > >> +.. code-block:: console
>> >>> > >> +
>> >>> > >> +       git clone https://github.com/riscv/opensbi.git
>> >>> > >> +       cd opensbi
>> >>> > >> +       make PLATFORM=generic FW_DYNAMIC=y
>> >>> > >> +
>> >>> > >> +Copy OpenSBI FW_DYNAMIC image
>> >>> > >> +(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
>> >>> > >> +root directory
>> >>> > >> +
>> >>> > >> +.. code-block:: console
>> >>> > >> +
>> >>> > >> +       cp build/platform/generic/firmware/fw_dynamic.bin
>> >>> > >> + <u-boot-dir>
>> >>> > >> +
>> >>> > >> +Now build the U-Boot SPL and U-Boot proper
>> >>> > >> +
>> >>> > >> +.. code-block:: console
>> >>> > >> +
>> >>> > >> +       cd <U-Boot-dir>
>> >>> > >> +       make sifive_fu540_defconfig
>> >>> > >> +       make
>> >>> > >> +
>> >>> > >> +This will generate spl/u-boot-spl.bin and FIT image
>> >>> > >> +(u-boot.itb)
>> >>> > >> +
>> >>> > >> +
>> >>> > >> +Flashing
>> >>> > >> +--------
>> >>> > >> +
>> >>> > >> +ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition
>> >>> > >> +with GUID type
>> >>> > >> +5B193300-FC78-40CD-8002-E86C45580B47
>> >>> > >> +
>> >>> > >> +U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a
>> >>> > >> +partition with GUID type
>> >>> > >> +2E54B353-1271-4842-806F-E436D6AF6985
>> >>> > >> +
>> >>> > >> +FIT image (u-boot.itb) is a combination of fw_dynamic.bin,
>> >>> > >> +u-boot-nodtb.bin and device tree blob
>> >>> > >> +(hifive-unleashed-a00.dtb)
>> >>> > >> +
>> >>> > >> +Format the SD card (make sure the disk has GPT, otherwise
>> >>> > >> +use gdisk to switch)
>> >>> > >> +
>> >>> > >> +.. code-block:: none
>> >>> > >> +
>> >>> > >> +       # sudo sgdisk --clear \
>> >>> > >> +       > --set-alignment=2 \
>> >>> > >> +       > --new=1:34:2081 --change-name=1:loader1
>> >>> > >> + --typecode=1:5B193300-
>> >>> > >FC78-40CD-8002-E86C45580B47 \
>> >>> > >> +       > --new=2:2082:10273 --change-name=2:loader2 --
>> >>> > >typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
>> >>> > >> +       > --new=3:10274: --change-name=3:rootfs
>> >>> > >> + --typecode=3:0FC63DAF-
>> >>> > >8483-4772-8E79-3D69D8477DE4 \
>> >>> > >> +       > /dev/sda
>> >>> > >> +
>> >>> > >> +Program the SD card
>> >>> > >> +
>> >>> > >> +.. code-block:: none
>> >>> > >> +
>> >>> > >> +       sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
>> >>> > >> +       sudo dd if=u-boot.itb of=/dev/sda seek=2082
>> >>> > >> +
>> >>> > >> +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.04-rc2-00109-g63efc7e07e-dirty (Apr
>> >>> > >> + 30
>> >>> > >> + 2020 -
>> >>> > >13:52:36 +0530)
>> >>> > >> +       Trying to boot from MMC1
>> >>> > >> +
>> >>> > >> +
>> >>> > >> +       U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30
>> >>> > >> + 2020
>> >>> > >> + -
>> >>> > >> + 13:52:36 +0530)
>> >>> > >> +
>> >>> > >> +       CPU:   rv64imafdc
>> >>> > >> +       Model: SiFive HiFive Unleashed A00
>> >>> > >> +       DRAM:  8 GiB
>> >>> > >> +       MMC:   spi@10050000:mmc@0: 0
>> >>> > >> +       In:    serial@10010000
>> >>> > >> +       Out:   serial@10010000
>> >>> > >> +       Err:   serial@10010000
>> >>> > >> +       Board serial number should not be 0 !!
>> >>> > >> +       Net:
>> >>> > >> +       Warning: ethernet@10090000 (eth0) using random MAC
>> >>> > >> + address -
>> >>> > >96:06:92:18:eb:04
>> >>> > >> +       eth0: ethernet@10090000
>> >>> > >> +       Hit any key to stop autoboot:  0
>> >>> > >
>> >>> > >Look like v10 seems to be a change, I can see memory region print?
>> >>> > >
>> >>> > >U-Boot SPL 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 -
>> >>> > >23:00:17
>> >>> > >+0530)
>> >>> > >Trying to boot from MMC1
>> >>> > >
>> >>> > >
>> >>> > >U-Boot 2020.07-rc1-00540-gd06cdf6989 (May 15 2020 - 23:00:17
>> >>> > >+0530)
>> >>> > >
>> >>> > >CPU:   rv64imafdc
>> >>> > >Model: SiFive HiFive Unleashed A00
>> >>> > >DRAM:  8 GiB
>> >>> > >No reserved memory region found in source FDT
>> >>> > >MMC:   spi@10050000:mmc@0: 0
>> >>> > >In:    serial@10010000
>> >>> > >Out:   serial@10010000
>> >>> > >Err:   serial@10010000
>> >>> > >Net:   eth0: ethernet@10090000
>> >>> > >Hit any key to stop autoboot:  0
>> >>> >
>> >>> > I haven't got this "memory region" print, can you please update
>> >>> > your U-Boot and OpenSBI Repo and recheck.
>> >>>
>> >>> I have checked with latest opensbi, still got it.
>> >>
>> >>Do you mean this message?
>> >>
>> >>  No reserved memory region found in source FDT
>> >>
>> >>If yes, you need use OpenSBI v0.7.
>> >>
>> >>>
>> >>> U-Boot SPL 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 -
>> >>> 21:33:36
>> >>> +0530) Trying to boot from MMC1
>> >>>
>> >>> OpenSBI v0.6
>> >>>    ____                    _____ ____ _____
>> >>>   / __ \                  / ____|  _ \_   _|
>> >>>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>> >>>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ |
>> >>> |
>> >>> |____) | |_) || |_
>> >>>   \____/| .__/ \___|_| |_|_____/|____/_____|
>> >>>         | |
>> >>>         |_|
>> >>>
>> >>> Platform Name          : SiFive Freedom U540
>> >>> Platform HART Features : RV64ACDFIMSU
>> >>> Platform Max HARTs     : 5
>> >>> Current Hart           : 3
>> >>> Firmware Base          : 0x80000000
>> >>> Firmware Size          : 100 KB
>> >>> Runtime SBI Version    : 0.2
>> >>>
>> >>> MIDELEG : 0x0000000000000222
>> >>> MEDELEG : 0x000000000000b109
>> >>> PMP0    : 0x0000000080000000-0x000000008001ffff (A)
>> >>> PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
>> >>>
>> >>>
>> >>> U-Boot 2020.07-rc2-00154-gb37b258d49-dirty (May 19 2020 - 21:33:36
>> >>> +0530)
>> >>>
>> >>> CPU:   rv64imafdc
>> >>> Model: SiFive HiFive Unleashed A00
>> >>> DRAM:  8 GiB
>> >>> No reserved memory region found in source FDT
>> >>> MMC:   spi@10050000:mmc@0: 0
>> >>> In:    serial@10010000
>> >>> Out:   serial@10010000
>> >>> Err:   serial@10010000
>> >>> Net:   eth0: ethernet@10090000
>> >>> Hit any key to stop autoboot:  0
>> >>>
>> >>> opensbi sha1:
>> >>> 89ba63493c4ce98861144180e408d6db391fd1c3
>> >
>> >I have updated my U-Boot and OpenSBI repo and recheck., still not
>> >getting this "reserved memory" print.
>> >
>> >Below is my observation from your boot prints:
>> >- It looks like your OpenSBI repo is not updated one. Latest OpenSBI
>> >version is
>> >v0.7 .
>> >- you are using "make PLATFORM=sifive/fu540" instead of " make
>> >PLATFORM=generic"
>> >
>> >Can you please rebuild OpenSBI with above suggestion and reconfirm.
>> >
>> >U-Boot sha1:
>> >c2279d784e35fa25ee3a9fa28a74a1ba545f8c1e
>> >(Merge branch '2020-05-18-reduce-size-of-common.h')
>> >
>> >OpenSBI sha1:
>> >89ba63493c4ce98861144180e408d6db391fd1c3
>> >(include: sbi: Add firmware extension constants)
>> >
>> >
>> >Boot prints:
>> >
>> >U-Boot SPL 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 -
>> >12:42:00
>> >+0530) Trying to boot from MMC1
>> >
>> >OpenSBI v0.7-59-g89ba634
>> >   ____                    _____ ____ _____
>> >  / __ \                  / ____|  _ \_   _|
>> > | |  | |_ __   ___ _ __ | (___ | |_) || |
>> > | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |  | |__| | |_) |  __/ | |
>> > | | |____) | |_) || |_
>> >  \____/| .__/ \___|_| |_|_____/|____/_____|
>> >        | |
>> >        |_|
>> >
>> >Platform Name       : SiFive HiFive Unleashed A00
>> >Platform Features   : timer,mfdeleg
>> >Platform HART Count : 5
>> >Boot HART ID        : 1
>> >Boot HART ISA       : rv64imafdcsu
>> >BOOT HART Features  : pmp,scounteren,mcounteren BOOT HART PMP
>Count :
>> >16
>> >Firmware Base       : 0x80000000
>> >Firmware Size       : 116 KB
>> >Runtime SBI Version : 0.2
>> >
>> >MIDELEG : 0x0000000000000222
>> >MEDELEG : 0x000000000000b109
>> >PMP0    : 0x0000000080000000-0x000000008001ffff (A)
>> >PMP1    : 0x0000000000000000-0x0000007fffffffff (A,R,W,X)
>> >
>> >
>> >U-Boot 2020.07-rc2-00711-g179f936b5c-dirty (May 20 2020 - 12:42:00
>> >+0530)
>> >
>> >CPU:   rv64imafdc
>> >Model: SiFive HiFive Unleashed A00
>> >DRAM:  8 GiB
>> >MMC:   spi@10050000:mmc@0: 0
>> >In:    serial@10010000
>> >Out:   serial@10010000
>> >Err:   serial@10010000
>> >Board serial number should not be 0 !!
>> >Net:
>> >Warning: ethernet@10090000 (eth0) using random MAC address -
>> >7a:3f:bf:c1:f9:29
>> >eth0: ethernet@10090000
>> >Hit any key to stop autoboot:  0
>> >=>
>>
>> Any comments ? I am planning to send v12.
>
>I did not see that. But I see your log has
>
>> >Warning: ethernet@10090000 (eth0) using random MAC address -
>> >7a:3f:bf:c1:f9:29
>
>and I did not see that. This means that OTP driver does not work on your
>board?

No OTP driver works perfectly fine, I have tested both read and write.

By mistake, I overwrite my board serial number that's why it shows  
" Board serial number should not be 0 !!" and ethernet mac address depends
on serial number so got that warning 
" Warning: ethernet@10090000 (eth0) using random MAC address -"

This works perfectly fine on other boards.
 
>
>Regards,
>Bin
diff mbox series

Patch

diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
index f805aacc7a..8d412f8d6a 100644
--- a/configs/sifive_fu540_defconfig
+++ b/configs/sifive_fu540_defconfig
@@ -1,6 +1,11 @@ 
 CONFIG_RISCV=y
+CONFIG_SPL_GPIO_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x3000
 CONFIG_ENV_SIZE=0x20000
+CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
+CONFIG_SPL=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_TARGET_SIFIVE_FU540=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
@@ -9,7 +14,10 @@  CONFIG_FIT=y
 CONFIG_MISC_INIT_R=y
 CONFIG_DISPLAY_CPUINFO=y
 CONFIG_DISPLAY_BOARDINFO=y
+CONFIG_SPL_SEPARATE_BSS=y
+CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_OF_BOARD_FIXUP=y
 CONFIG_DEFAULT_DEVICE_TREE="hifive-unleashed-a00"
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SPL_CLK=y
 CONFIG_DM_MTD=y
diff --git a/doc/board/sifive/fu540.rst b/doc/board/sifive/fu540.rst
index 610ba87074..89e8d66c56 100644
--- a/doc/board/sifive/fu540.rst
+++ b/doc/board/sifive/fu540.rst
@@ -31,6 +31,9 @@  TODO:
         stdout-path = "/soc/serial@10010000:115200";
    };
 
+Booting from MMC using FSBL
+---------------------------
+
 Building
 --------
 
@@ -421,3 +424,134 @@  as well.
 
    Please press Enter to activate this console.
    / #
+
+Booting from MMC using U-Boot SPL
+---------------------------------
+
+Building
+--------
+
+Before building U-Boot SPL, OpenSBI must be built first. OpenSBI can be
+cloned and built for FU540 as below:
+
+.. code-block:: console
+
+	git clone https://github.com/riscv/opensbi.git
+	cd opensbi
+	make PLATFORM=generic FW_DYNAMIC=y
+
+Copy OpenSBI FW_DYNAMIC image
+(build/platform/generic/firmware/fw_dynamic.bin) into U-Boot
+root directory
+
+.. code-block:: console
+
+	cp build/platform/generic/firmware/fw_dynamic.bin <u-boot-dir>
+
+Now build the U-Boot SPL and U-Boot proper
+
+.. code-block:: console
+
+	cd <U-Boot-dir>
+	make sifive_fu540_defconfig
+	make
+
+This will generate spl/u-boot-spl.bin and FIT image (u-boot.itb)
+
+
+Flashing
+--------
+
+ZSBL loads the U-Boot SPL (u-boot-spl.bin) from a partition with GUID type
+5B193300-FC78-40CD-8002-E86C45580B47
+
+U-Boot SPL expects a U-Boot FIT image (u-boot.itb) from a partition with GUID
+type 2E54B353-1271-4842-806F-E436D6AF6985
+
+FIT image (u-boot.itb) is a combination of fw_dynamic.bin, u-boot-nodtb.bin and
+device tree blob (hifive-unleashed-a00.dtb)
+
+Format the SD card (make sure the disk has GPT, otherwise use gdisk to switch)
+
+.. code-block:: none
+
+	# sudo sgdisk --clear \
+	> --set-alignment=2 \
+	> --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \
+	> --new=2:2082:10273 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
+	> --new=3:10274: --change-name=3:rootfs --typecode=3:0FC63DAF-8483-4772-8E79-3D69D8477DE4 \
+	> /dev/sda
+
+Program the SD card
+
+.. code-block:: none
+
+	sudo dd if=spl/u-boot-spl.bin of=/dev/sda seek=34
+	sudo dd if=u-boot.itb of=/dev/sda seek=2082
+
+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.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 - 13:52:36 +0530)
+	Trying to boot from MMC1
+
+
+	U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 - 13:52:36 +0530)
+
+	CPU:   rv64imafdc
+	Model: SiFive HiFive Unleashed A00
+	DRAM:  8 GiB
+	MMC:   spi@10050000:mmc@0: 0
+	In:    serial@10010000
+	Out:   serial@10010000
+	Err:   serial@10010000
+	Board serial number should not be 0 !!
+	Net:
+	Warning: ethernet@10090000 (eth0) using random MAC address - 96:06:92:18:eb:04
+	eth0: ethernet@10090000
+	Hit any key to stop autoboot:  0
+	=> version
+	U-Boot 2020.04-rc2-00109-g63efc7e07e-dirty (Apr 30 2020 - 13:52:36 +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@10050000:mmc@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     0x00000022      0x00000821      "loader1"
+	attrs:  0x0000000000000000
+	type:   5b193300-fc78-40cd-8002-e86c45580b47
+	guid:   66e2b5d2-74db-4df8-ad6f-694b3617f87f
+	2     0x00000822      0x00002821      "loader2"
+	attrs:  0x0000000000000000
+	type:   2e54b353-1271-4842-806f-e436d6af6985
+	guid:   8befaeaf-bca0-435d-b002-e201f37c0a2f
+	3     0x00002822      0x01dacbde      "rootfs"
+	attrs:  0x0000000000000000
+	type:   0fc63daf-8483-4772-8e79-3d69d8477de4
+	type:   linux
+	guid:   9faa81b6-39b1-4418-af5e-89c48f29c20d