mbox series

[v2,0/9] riscv: sifive/fu540: Booting from SPI

Message ID 20200519192340.16624-1-jagan@amarulasolutions.com
Headers show
Series riscv: sifive/fu540: Booting from SPI | expand

Message

Jagan Teki May 19, 2020, 7:23 p.m. UTC
This series support Boot from SPI on SiFive FU540 HiFive Unleashed 
board, with improved version of detecting bootmode at runtime.

Previous version changes are at [1].

Changes for v2:
- fu540 board driver
- runtime bootmode detection
- rebase on Pragnesh v11 series

[1] https://patchwork.ozlabs.org/project/uboot/cover/20200420140514.25847-1-jagan@amarulasolutions.com/

Any inputs?
Jagan.

Jagan Teki (9):
  spl: Try to get SPL boot device via board_get_int
  dt-bindings: board: Document sifive,fu540-modeselect
  riscv: dts: fu540-c000-u-boot: Add sifive,fu540-modeselect
  drivers: Add fu540 board driver
  sifive: fu540: Add Booting from SPI
  env: Enable SPI flash env for SiFive FU540
  sifive: fu540: Mark the default env as SPI flash
  sifive: fu540: Add boot flash script offset, size
  sifive: fu540: Enable SF distro bootcmd

 arch/riscv/cpu/fu540/Kconfig                  | 15 ++++
 arch/riscv/dts/fu540-c000-u-boot.dtsi         |  7 ++
 .../dts/hifive-unleashed-a00-u-boot.dtsi      | 12 +++
 board/sifive/fu540/Kconfig                    |  1 +
 board/sifive/fu540/fu540.c                    | 12 ---
 common/spl/spl.c                              | 14 ++-
 configs/sifive_fu540_defconfig                |  4 +
 doc/board/sifive/fu540.rst                    | 41 +++++++++
 .../board/sifive,fu540-modeselect.txt         | 15 ++++
 drivers/board/Kconfig                         |  8 ++
 drivers/board/Makefile                        |  1 +
 drivers/board/fu540.c                         | 86 +++++++++++++++++++
 include/board.h                               |  9 ++
 include/configs/sifive-fu540.h                |  7 +-
 14 files changed, 218 insertions(+), 14 deletions(-)
 create mode 100644 doc/device-tree-bindings/board/sifive,fu540-modeselect.txt
 create mode 100644 drivers/board/fu540.c

Comments

Bin Meng May 25, 2020, 2:10 a.m. UTC | #1
Hi Jagan,

On Wed, May 20, 2020 at 3:24 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
>
> This series support Boot from SPI on SiFive FU540 HiFive Unleashed
> board, with improved version of detecting bootmode at runtime.
>
> Previous version changes are at [1].
>
> Changes for v2:
> - fu540 board driver
> - runtime bootmode detection
> - rebase on Pragnesh v11 series
>
> [1] https://patchwork.ozlabs.org/project/uboot/cover/20200420140514.25847-1-jagan@amarulasolutions.com/
>
> Any inputs?

It looks this series does not build?

$ make sifive_fu540_defconfig
$ make -j32
scripts/kconfig/conf  --syncconfig Kconfig
.config:36:warning: symbol value '' invalid for ENV_OFFSET
.config:37:warning: symbol value '' invalid for ENV_SECT_SIZE
*
* Restart config...
*
*
* Environment
*
Environment is not stored (ENV_IS_NOWHERE) [N/y/?] n
Environment in EEPROM (ENV_IS_IN_EEPROM) [N/y/?] n
Environment is in a FAT filesystem (ENV_IS_IN_FAT) [N/y/?] n
Environment is in a EXT4 filesystem (ENV_IS_IN_EXT4) [N/y/?] n
Environment in flash memory (ENV_IS_IN_FLASH) [N/y/?] n
Environment in an MMC device (ENV_IS_IN_MMC) [N/y/?] n
Environment in a NAND device (ENV_IS_IN_NAND) [N/y/?] n
Environment in a non-volatile RAM (ENV_IS_IN_NVRAM) [N/y/?] n
Environment is in OneNAND (ENV_IS_IN_ONENAND) [N/y/?] n
Environment is in remote memory space (ENV_IS_IN_REMOTE) [N/y/?] n
Environment is in SPI flash (ENV_IS_IN_SPI_FLASH) [Y/?] y
  SPI flash bus for environment (USE_ENV_SPI_BUS) [N/y/?] n
  SPI flash chip select for environment (USE_ENV_SPI_CS) [N/y/?] n
  SPI flash max frequency for environment (USE_ENV_SPI_MAX_HZ) [N/y/?] n
  SPI flash mode for environment (USE_ENV_SPI_MODE) [N/y/?] n
Enable redundant environment support (SYS_REDUNDAND_ENVIRONMENT) [N/y/?] n
Environment address (ENV_ADDR) [0x0] 0x0
Environment offset (ENV_OFFSET) [] (NEW)
^Cscripts/kconfig/Makefile:75: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Interrupt
Makefile:565: recipe for target 'syncconfig' failed
make[1]: *** [syncconfig] Interrupt

Regards,
Bin
Bin Meng May 25, 2020, 2:27 a.m. UTC | #2
On Mon, May 25, 2020 at 10:10 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> Hi Jagan,
>
> On Wed, May 20, 2020 at 3:24 AM Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > This series support Boot from SPI on SiFive FU540 HiFive Unleashed
> > board, with improved version of detecting bootmode at runtime.
> >
> > Previous version changes are at [1].
> >
> > Changes for v2:
> > - fu540 board driver
> > - runtime bootmode detection
> > - rebase on Pragnesh v11 series
> >
> > [1] https://patchwork.ozlabs.org/project/uboot/cover/20200420140514.25847-1-jagan@amarulasolutions.com/
> >
> > Any inputs?
>
> It looks this series does not build?
>
> $ make sifive_fu540_defconfig
> $ make -j32
> scripts/kconfig/conf  --syncconfig Kconfig
> .config:36:warning: symbol value '' invalid for ENV_OFFSET
> .config:37:warning: symbol value '' invalid for ENV_SECT_SIZE
> *
> * Restart config...
> *
> *
> * Environment
> *
> Environment is not stored (ENV_IS_NOWHERE) [N/y/?] n
> Environment in EEPROM (ENV_IS_IN_EEPROM) [N/y/?] n
> Environment is in a FAT filesystem (ENV_IS_IN_FAT) [N/y/?] n
> Environment is in a EXT4 filesystem (ENV_IS_IN_EXT4) [N/y/?] n
> Environment in flash memory (ENV_IS_IN_FLASH) [N/y/?] n
> Environment in an MMC device (ENV_IS_IN_MMC) [N/y/?] n
> Environment in a NAND device (ENV_IS_IN_NAND) [N/y/?] n
> Environment in a non-volatile RAM (ENV_IS_IN_NVRAM) [N/y/?] n
> Environment is in OneNAND (ENV_IS_IN_ONENAND) [N/y/?] n
> Environment is in remote memory space (ENV_IS_IN_REMOTE) [N/y/?] n
> Environment is in SPI flash (ENV_IS_IN_SPI_FLASH) [Y/?] y
>   SPI flash bus for environment (USE_ENV_SPI_BUS) [N/y/?] n
>   SPI flash chip select for environment (USE_ENV_SPI_CS) [N/y/?] n
>   SPI flash max frequency for environment (USE_ENV_SPI_MAX_HZ) [N/y/?] n
>   SPI flash mode for environment (USE_ENV_SPI_MODE) [N/y/?] n
> Enable redundant environment support (SYS_REDUNDAND_ENVIRONMENT) [N/y/?] n
> Environment address (ENV_ADDR) [0x0] 0x0
> Environment offset (ENV_OFFSET) [] (NEW)
> ^Cscripts/kconfig/Makefile:75: recipe for target 'syncconfig' failed
> make[2]: *** [syncconfig] Interrupt
> Makefile:565: recipe for target 'syncconfig' failed
> make[1]: *** [syncconfig] Interrupt

Simply fixed the build by:

diff --git a/arch/riscv/cpu/fu540/Kconfig b/arch/riscv/cpu/fu540/Kconfig
index 417926d..64f2b93 100644
--- a/arch/riscv/cpu/fu540/Kconfig
+++ b/arch/riscv/cpu/fu540/Kconfig
@@ -16,8 +16,6 @@ config SIFIVE_FU540
        imply SPL_OPENSBI
        imply SPL_LOAD_FIT

-if CONFIG_ENV_IS_IN_SPI_FLASH
-
 config ENV_OFFSET
        default 0x505000

@@ -26,5 +24,3 @@ config ENV_SIZE

 config ENV_SECT_SIZE
        default 0x10000
-
-endif # CONFIG_ENV_IS_IN_SPI_FLASH

Regards,
Bin