diff mbox series

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

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

Commit Message

Pragnesh Patel May 2, 2020, 10:06 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 + 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>
---
 configs/sifive_fu540_defconfig | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Bin Meng May 2, 2020, 12:55 p.m. UTC | #1
Hi Pragnesh,

On Sat, May 2, 2020 at 6:08 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 + 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>
> ---
>  configs/sifive_fu540_defconfig | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
> index f805aacc7a..30fac8996b 100644
> --- a/configs/sifive_fu540_defconfig
> +++ b/configs/sifive_fu540_defconfig
> @@ -1,6 +1,12 @@
>  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_SPL_PAYLOAD="u-boot.itb"
>  CONFIG_TARGET_SIFIVE_FU540=y
>  CONFIG_ARCH_RV64I=y
>  CONFIG_RISCV_SMODE=y
> @@ -9,7 +15,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

Is this needed for SPL?

>  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

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

>-----Original Message-----
>From: Bin Meng <bmeng.cn@gmail.com>
>Sent: 02 May 2020 18:26
>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>; Troy Benjegerdes
><troy.benjegerdes@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 v7 18/22] 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 Sat, May 2, 2020 at 6:08 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 + 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>
>> ---
>>  configs/sifive_fu540_defconfig | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/configs/sifive_fu540_defconfig
>> b/configs/sifive_fu540_defconfig index f805aacc7a..30fac8996b 100644
>> --- a/configs/sifive_fu540_defconfig
>> +++ b/configs/sifive_fu540_defconfig
>> @@ -1,6 +1,12 @@
>>  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_SPL_PAYLOAD="u-boot.itb"
>>  CONFIG_TARGET_SIFIVE_FU540=y
>>  CONFIG_ARCH_RV64I=y
>>  CONFIG_RISCV_SMODE=y
>> @@ -9,7 +15,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
>
>Is this needed for SPL?

No, it's not needed. Will check and remove in v8.

>
>>  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
>
>Regards,
>Bin
Jagan Teki May 2, 2020, 4:51 p.m. UTC | #3
On Sat, May 2, 2020 at 3:38 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 + 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>
> ---

squash with 12/22 and 22/22.
Jagan Teki May 2, 2020, 5:04 p.m. UTC | #4
On Sat, May 2, 2020 at 6:25 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Pragnesh,
>
> On Sat, May 2, 2020 at 6:08 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 + 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>
> > ---
> >  configs/sifive_fu540_defconfig | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
> > index f805aacc7a..30fac8996b 100644
> > --- a/configs/sifive_fu540_defconfig
> > +++ b/configs/sifive_fu540_defconfig
> > @@ -1,6 +1,12 @@
> >  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_SPL_PAYLOAD="u-boot.itb"

This won't require.

> >  CONFIG_TARGET_SIFIVE_FU540=y
> >  CONFIG_ARCH_RV64I=y
> >  CONFIG_RISCV_SMODE=y
> > @@ -9,7 +15,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
>
> Is this needed for SPL?

Yes, it is required for mmc_spi to build on the SPL side.

riscv64-buildroot-linux-gnu-ld.bfd: drivers/built-in.o: in function
`mmc_spi_readdata':
u-boot/drivers/mmc/mmc_spi.c:157: undefined reference to `crc16_ccitt'
riscv64-buildroot-linux-gnu-ld.bfd: drivers/built-in.o: in function
`dm_mmc_spi_request':
u-boot/drivers/mmc/mmc_spi.c:368: undefined reference to `crc16_ccitt'

Jagan.
Jagan Teki May 2, 2020, 5:15 p.m. UTC | #5
On Sat, May 2, 2020 at 3:38 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 + 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"
>

Prior to this patch you have
https://patchwork.ozlabs.org/project/uboot/patch/20200420133735.23599-1-jagan@amarulasolutions.com/
https://patchwork.ozlabs.org/project/uboot/patch/20200420133735.23599-2-jagan@amarulasolutions.com/

in the series, otherwise it will not boot from MMC with this series.

Jagan.
Pragnesh Patel May 3, 2020, 7:20 a.m. UTC | #6
Hi jagan,

>-----Original Message-----
>From: Jagan Teki <jagan@amarulasolutions.com>
>Sent: 02 May 2020 22:45
>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>;
>Troy Benjegerdes <troy.benjegerdes@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 v7 18/22] 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 Sat, May 2, 2020 at 3:38 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 + 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"
>>
>
>Prior to this patch you have
>https://patchwork.ozlabs.org/project/uboot/patch/20200420133735.23599-1-
>jagan@amarulasolutions.com/
>https://patchwork.ozlabs.org/project/uboot/patch/20200420133735.23599-2-
>jagan@amarulasolutions.com/
>
>in the series, otherwise it will not boot from MMC with this series.

Will incorporate in v8.

>
>Jagan.
Pragnesh Patel May 4, 2020, 3:48 p.m. UTC | #7
Hi Jagan,

>-----Original Message-----
>From: Jagan Teki <jagan@amarulasolutions.com>
>Sent: 02 May 2020 22:22
>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>;
>Troy Benjegerdes <troy.benjegerdes@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 v7 18/22] 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 Sat, May 2, 2020 at 3:38 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 + 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>
>> ---
>
>squash with 12/22 and 22/22.

IMHO, it's better to squash this patch with 22/22 and squash 12/22 with 17/22.
diff mbox series

Patch

diff --git a/configs/sifive_fu540_defconfig b/configs/sifive_fu540_defconfig
index f805aacc7a..30fac8996b 100644
--- a/configs/sifive_fu540_defconfig
+++ b/configs/sifive_fu540_defconfig
@@ -1,6 +1,12 @@ 
 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_SPL_PAYLOAD="u-boot.itb"
 CONFIG_TARGET_SIFIVE_FU540=y
 CONFIG_ARCH_RV64I=y
 CONFIG_RISCV_SMODE=y
@@ -9,7 +15,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