All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] rockchip: rk3399: Add SPI boot
@ 2020-06-04 14:51 ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: Kever Yang, Philipp Tomsich, Simon Glass, Hugh Cole-Baker
  Cc: Suniel Mahesh, U-Boot-Denx, linux-rockchip, linux-amarula, Jagan Teki

Thanks to Hugh Cole-Baker for inputs about SPI boot
image creation.

V2 changes can be available at [1]
Changes for v3:
- SPI env offset, size changes based on roc-rk3399-pc
Changes for v2:
- same defconfig to support both MMC, SPI boot
- add spi flash program document 

Any inputs?
Jagan.

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

Jagan Teki (4):
  Makefile: Drop to handle rkspi image type
  roc-rk3399-pc: Mark default env from SPI
  roc-rk3399-pc: Add SPI boot
  doc: rockchip: Document SPI flash program steps

 Makefile                                  | 11 ++--------
 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi    | 12 ++++++++++-
 configs/roc-pc-mezzanine-rk3399_defconfig |  9 ++++++--
 configs/roc-pc-rk3399_defconfig           |  9 ++++++--
 doc/board/rockchip/rockchip.rst           | 26 ++++++++++++++++++++++-
 include/configs/roc-pc-rk3399.h           |  4 ----
 6 files changed, 52 insertions(+), 19 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 0/4] rockchip: rk3399: Add SPI boot
@ 2020-06-04 14:51 ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: u-boot

Thanks to Hugh Cole-Baker for inputs about SPI boot
image creation.

V2 changes can be available at [1]
Changes for v3:
- SPI env offset, size changes based on roc-rk3399-pc
Changes for v2:
- same defconfig to support both MMC, SPI boot
- add spi flash program document 

Any inputs?
Jagan.

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

Jagan Teki (4):
  Makefile: Drop to handle rkspi image type
  roc-rk3399-pc: Mark default env from SPI
  roc-rk3399-pc: Add SPI boot
  doc: rockchip: Document SPI flash program steps

 Makefile                                  | 11 ++--------
 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi    | 12 ++++++++++-
 configs/roc-pc-mezzanine-rk3399_defconfig |  9 ++++++--
 configs/roc-pc-rk3399_defconfig           |  9 ++++++--
 doc/board/rockchip/rockchip.rst           | 26 ++++++++++++++++++++++-
 include/configs/roc-pc-rk3399.h           |  4 ----
 6 files changed, 52 insertions(+), 19 deletions(-)

-- 
2.25.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 1/4] Makefile: Drop to handle rkspi image type
  2020-06-04 14:51 ` Jagan Teki
@ 2020-06-04 14:51     ` Jagan Teki
  -1 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: Kever Yang, Philipp Tomsich, Simon Glass, Hugh Cole-Baker
  Cc: U-Boot-Denx, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-amarula, Jagan Teki, Suniel Mahesh

On rockchip platforms, SPI boot image creation is not
straightforward like MMC boot image creation where former
requires to specify tpl, spl in multimage format in mkimage,
and later simply do a concatenate mkimaged-tpl with spl.

On this note, let drop rkspi image type creation via kbuild
and let inform via rockchip.rst

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
Changes for v3:
- none

 Makefile | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 3851dd9fa0..db3b6b9991 100644
--- a/Makefile
+++ b/Makefile
@@ -1438,22 +1438,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
 
-# rockchip image type
-ifeq ($(CONFIG_SPL_SPI_LOAD),y)
-ROCKCHIP_IMG_TYPE := rkspi
-else
-ROCKCHIP_IMG_TYPE := rksd
-endif
-
 # TPL + SPL
 ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
-MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
 else
-MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
 idbloader.img: spl/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 endif
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 1/4] Makefile: Drop to handle rkspi image type
@ 2020-06-04 14:51     ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: u-boot

On rockchip platforms, SPI boot image creation is not
straightforward like MMC boot image creation where former
requires to specify tpl, spl in multimage format in mkimage,
and later simply do a concatenate mkimaged-tpl with spl.

On this note, let drop rkspi image type creation via kbuild
and let inform via rockchip.rst

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
Changes for v3:
- none

 Makefile | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 3851dd9fa0..db3b6b9991 100644
--- a/Makefile
+++ b/Makefile
@@ -1438,22 +1438,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
 
 ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
 
-# rockchip image type
-ifeq ($(CONFIG_SPL_SPI_LOAD),y)
-ROCKCHIP_IMG_TYPE := rkspi
-else
-ROCKCHIP_IMG_TYPE := rksd
-endif
-
 # TPL + SPL
 ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
-MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
 tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
 	$(call if_changed,mkimage)
 idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
 	$(call if_changed,cat)
 else
-MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
+MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
 idbloader.img: spl/u-boot-spl.bin FORCE
 	$(call if_changed,mkimage)
 endif
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 2/4] roc-rk3399-pc: Mark default env from SPI
  2020-06-04 14:51 ` Jagan Teki
@ 2020-06-04 14:51     ` Jagan Teki
  -1 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: Kever Yang, Philipp Tomsich, Simon Glass, Hugh Cole-Baker
  Cc: U-Boot-Denx, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-amarula, Jagan Teki, Suniel Mahesh

Mark the default U-Boot environment as SPI flash since
this is an on board flash device.

Updated env offset, size in contrast with default since
the U-Boot proper has to start from 384K.

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
Changes for v3:
- updated env settings

 configs/roc-pc-mezzanine-rk3399_defconfig | 6 ++++--
 configs/roc-pc-rk3399_defconfig           | 6 ++++--
 include/configs/roc-pc-rk3399.h           | 4 ----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
index 1c1539bcb9..3b91c25ff4 100644
--- a/configs/roc-pc-mezzanine-rk3399_defconfig
+++ b/configs/roc-pc-mezzanine-rk3399_defconfig
@@ -1,7 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
-CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_SIZE=0x6000
+CONFIG_ENV_OFFSET=0x460000
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
@@ -25,7 +27,7 @@ CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3399-roc-pc-mezzanine"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 76e76c160e..6edd4a8822 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -1,7 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
-CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_SIZE=0x6000
+CONFIG_ENV_OFFSET=0x460000
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
@@ -24,7 +26,7 @@ CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3399-roc-pc"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
diff --git a/include/configs/roc-pc-rk3399.h b/include/configs/roc-pc-rk3399.h
index d4cbc3532e..59fe22289c 100644
--- a/include/configs/roc-pc-rk3399.h
+++ b/include/configs/roc-pc-rk3399.h
@@ -13,10 +13,6 @@
 
 #include <configs/rk3399_common.h>
 
-#if defined(CONFIG_ENV_IS_IN_MMC)
-# define CONFIG_SYS_MMC_ENV_DEV		0
-#endif
-
 #define SDRAM_BANK_SIZE			(2UL << 30)
 
 #endif
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 2/4] roc-rk3399-pc: Mark default env from SPI
@ 2020-06-04 14:51     ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: u-boot

Mark the default U-Boot environment as SPI flash since
this is an on board flash device.

Updated env offset, size in contrast with default since
the U-Boot proper has to start from 384K.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
Changes for v3:
- updated env settings

 configs/roc-pc-mezzanine-rk3399_defconfig | 6 ++++--
 configs/roc-pc-rk3399_defconfig           | 6 ++++--
 include/configs/roc-pc-rk3399.h           | 4 ----
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
index 1c1539bcb9..3b91c25ff4 100644
--- a/configs/roc-pc-mezzanine-rk3399_defconfig
+++ b/configs/roc-pc-mezzanine-rk3399_defconfig
@@ -1,7 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
-CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_SIZE=0x6000
+CONFIG_ENV_OFFSET=0x460000
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
@@ -25,7 +27,7 @@ CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3399-roc-pc-mezzanine"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 76e76c160e..6edd4a8822 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -1,7 +1,9 @@
 CONFIG_ARM=y
 CONFIG_ARCH_ROCKCHIP=y
 CONFIG_SYS_TEXT_BASE=0x00200000
-CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_ENV_SIZE=0x6000
+CONFIG_ENV_OFFSET=0x460000
+CONFIG_ENV_SECT_SIZE=0x1000
 CONFIG_ROCKCHIP_RK3399=y
 CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
@@ -24,7 +26,7 @@ CONFIG_CMD_TIME=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="rk3399-roc-pc"
 CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
-CONFIG_ENV_IS_IN_MMC=y
+CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ROCKCHIP_GPIO=y
 CONFIG_SYS_I2C_ROCKCHIP=y
diff --git a/include/configs/roc-pc-rk3399.h b/include/configs/roc-pc-rk3399.h
index d4cbc3532e..59fe22289c 100644
--- a/include/configs/roc-pc-rk3399.h
+++ b/include/configs/roc-pc-rk3399.h
@@ -13,10 +13,6 @@
 
 #include <configs/rk3399_common.h>
 
-#if defined(CONFIG_ENV_IS_IN_MMC)
-# define CONFIG_SYS_MMC_ENV_DEV		0
-#endif
-
 #define SDRAM_BANK_SIZE			(2UL << 30)
 
 #endif
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 3/4] roc-rk3399-pc: Add SPI boot
  2020-06-04 14:51 ` Jagan Teki
@ 2020-06-04 14:51     ` Jagan Teki
  -1 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: Kever Yang, Philipp Tomsich, Simon Glass, Hugh Cole-Baker
  Cc: U-Boot-Denx, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-amarula, Jagan Teki, Suniel Mahesh

U-Boot TPL 2020.07-rc3-00090-gd4e919f927-dirty (Jun 01 2020 - 23:45:53)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.07-rc3-00087-ga21e9fd385 (Jun 02 2020 - 00:09:45 +0530)
Trying to boot from MMC1
NOTICE:  BL31: v2.2(release):
NOTICE:  BL31: Built : 15:05:37, May 12 2020

U-Boot 2020.07-rc3-00087-ga21e9fd385 (Jun 02 2020 - 00:09:45 +0530)

SoC: Rockchip rk3399
Reset cause: POR
Model: Firefly ROC-RK3399-PC Board
DRAM:  3.9 GiB
PMIC:  RK808
MMC:   mmc@fe320000: 1, sdhci@fe330000: 0
Loading Environment from SPI Flash... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Firefly ROC-RK3399-PC Board

Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
Changes for v3:
- none

 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi    | 12 +++++++++++-
 configs/roc-pc-mezzanine-rk3399_defconfig |  3 +++
 configs/roc-pc-rk3399_defconfig           |  3 +++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
index 141dd0b306..fc155e6903 100644
--- a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
@@ -12,7 +12,11 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
+		u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdhci, &sdmmc;
+	};
+
+	config {
+		u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */
 	};
 
 	vcc_hub_en: vcc_hub_en-regulator {
@@ -40,6 +44,12 @@
 	vin-supply = <&vcc_vbus_typec0>;
 };
 
+&spi1 {
+	spi_flash: flash@0 {
+		u-boot,dm-pre-reloc;
+	};
+};
+
 &vdd_log {
 	regulator-min-microvolt = <430000>;
 	regulator-init-microvolt = <950000>;
diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
index 3b91c25ff4..fd1b85c1e4 100644
--- a/configs/roc-pc-mezzanine-rk3399_defconfig
+++ b/configs/roc-pc-mezzanine-rk3399_defconfig
@@ -9,12 +9,15 @@ CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEBUG_UART=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-mezzanine.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_SPL_SPI_LOAD=y
 CONFIG_TPL=y
 CONFIG_TPL_GPIO_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 6edd4a8822..80e7001481 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -9,12 +9,15 @@ CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEBUG_UART=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_SPL_SPI_LOAD=y
 CONFIG_TPL=y
 CONFIG_TPL_GPIO_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 3/4] roc-rk3399-pc: Add SPI boot
@ 2020-06-04 14:51     ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: u-boot

U-Boot TPL 2020.07-rc3-00090-gd4e919f927-dirty (Jun 01 2020 - 23:45:53)
Channel 0: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
Channel 1: LPDDR4, 50MHz
BW=32 Col=10 Bk=8 CS0 Row=15 CS1 Row=15 CS=2 Die BW=16 Size=2048MB
256B stride
256B stride
lpddr4_set_rate: change freq to 400000000 mhz 0, 1
lpddr4_set_rate: change freq to 800000000 mhz 1, 0
Trying to boot from BOOTROM
Returning to boot ROM...

U-Boot SPL 2020.07-rc3-00087-ga21e9fd385 (Jun 02 2020 - 00:09:45 +0530)
Trying to boot from MMC1
NOTICE:  BL31: v2.2(release):
NOTICE:  BL31: Built : 15:05:37, May 12 2020

U-Boot 2020.07-rc3-00087-ga21e9fd385 (Jun 02 2020 - 00:09:45 +0530)

SoC: Rockchip rk3399
Reset cause: POR
Model: Firefly ROC-RK3399-PC Board
DRAM:  3.9 GiB
PMIC:  RK808
MMC:   mmc at fe320000: 1, sdhci at fe330000: 0
Loading Environment from SPI Flash... SF: Detected w25q128 with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Model: Firefly ROC-RK3399-PC Board

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
Changes for v3:
- none

 arch/arm/dts/rk3399-roc-pc-u-boot.dtsi    | 12 +++++++++++-
 configs/roc-pc-mezzanine-rk3399_defconfig |  3 +++
 configs/roc-pc-rk3399_defconfig           |  3 +++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
index 141dd0b306..fc155e6903 100644
--- a/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
+++ b/arch/arm/dts/rk3399-roc-pc-u-boot.dtsi
@@ -12,7 +12,11 @@
 	};
 
 	chosen {
-		u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
+		u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdhci, &sdmmc;
+	};
+
+	config {
+		u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */
 	};
 
 	vcc_hub_en: vcc_hub_en-regulator {
@@ -40,6 +44,12 @@
 	vin-supply = <&vcc_vbus_typec0>;
 };
 
+&spi1 {
+	spi_flash: flash at 0 {
+		u-boot,dm-pre-reloc;
+	};
+};
+
 &vdd_log {
 	regulator-min-microvolt = <430000>;
 	regulator-init-microvolt = <950000>;
diff --git a/configs/roc-pc-mezzanine-rk3399_defconfig b/configs/roc-pc-mezzanine-rk3399_defconfig
index 3b91c25ff4..fd1b85c1e4 100644
--- a/configs/roc-pc-mezzanine-rk3399_defconfig
+++ b/configs/roc-pc-mezzanine-rk3399_defconfig
@@ -9,12 +9,15 @@ CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEBUG_UART=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc-mezzanine.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_SPL_SPI_LOAD=y
 CONFIG_TPL=y
 CONFIG_TPL_GPIO_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
diff --git a/configs/roc-pc-rk3399_defconfig b/configs/roc-pc-rk3399_defconfig
index 6edd4a8822..80e7001481 100644
--- a/configs/roc-pc-rk3399_defconfig
+++ b/configs/roc-pc-rk3399_defconfig
@@ -9,12 +9,15 @@ CONFIG_TARGET_ROC_PC_RK3399=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_DEBUG_UART_BASE=0xFF1A0000
 CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SPL_SPI_FLASH_SUPPORT=y
+CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_DEBUG_UART=y
 CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-roc-pc.dtb"
 CONFIG_DISPLAY_BOARDINFO_LATE=y
 # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+CONFIG_SPL_SPI_LOAD=y
 CONFIG_TPL=y
 CONFIG_TPL_GPIO_SUPPORT=y
 CONFIG_CMD_BOOTZ=y
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 4/4] doc: rockchip: Document SPI flash program steps
  2020-06-04 14:51 ` Jagan Teki
@ 2020-06-04 14:51     ` Jagan Teki
  -1 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: Kever Yang, Philipp Tomsich, Simon Glass, Hugh Cole-Baker
  Cc: U-Boot-Denx, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-amarula, Jagan Teki, Suniel Mahesh

Document SPI flash program steps for rockchip platforms.

Suggested-by: Hugh Cole-Baker <sigmaris-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Signed-off-by: Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
Reviewed-by: Kever Yang <kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
---
Changes for v3:
- none
 
 doc/board/rockchip/rockchip.rst | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
index 7b72fab496..76b228a046 100644
--- a/doc/board/rockchip/rockchip.rst
+++ b/doc/board/rockchip/rockchip.rst
@@ -162,6 +162,30 @@ Program the flash::
 Note: for rockchip 32-bit platforms the U-Boot proper image
 is u-boot-dtb.img
 
+SPI
+^^^
+
+Generating idbloader for SPI boot would require to input a multi image
+image format to mkimage tool instead of concerting (like for MMC boot).
+
+SPL-alone SPI boot image::
+
+        ./tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin idbloader.img
+
+TPL+SPL SPI boot image::
+
+        ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img
+
+Copy SPI boot images into SD card and boot from SD::
+
+        sf probe
+        load mmc 1:1 $kernel_addr_r idbloader.img
+        sf erase 0 +$filesize
+        sf write $kernel_addr_r 0 ${filesize}
+        load mmc 1:1 ${kernel_addr_r} u-boot.itb
+        sf erase 0x60000 +$filesize
+        sf write $kernel_addr_r 0x60000 ${filesize}
+
 TODO
 ----
 
@@ -171,4 +195,4 @@ TODO
 - Add missing SoC's with it boards list
 
 .. Jagan Teki <jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
-.. Sunday 24 May 2020 10:08:41 PM IST
+.. Tuesday 02 June 2020 12:18:57 AM IST
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v3 4/4] doc: rockchip: Document SPI flash program steps
@ 2020-06-04 14:51     ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 14:51 UTC (permalink / raw)
  To: u-boot

Document SPI flash program steps for rockchip platforms.

Suggested-by: Hugh Cole-Baker <sigmaris@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
---
Changes for v3:
- none
 
 doc/board/rockchip/rockchip.rst | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/doc/board/rockchip/rockchip.rst b/doc/board/rockchip/rockchip.rst
index 7b72fab496..76b228a046 100644
--- a/doc/board/rockchip/rockchip.rst
+++ b/doc/board/rockchip/rockchip.rst
@@ -162,6 +162,30 @@ Program the flash::
 Note: for rockchip 32-bit platforms the U-Boot proper image
 is u-boot-dtb.img
 
+SPI
+^^^
+
+Generating idbloader for SPI boot would require to input a multi image
+image format to mkimage tool instead of concerting (like for MMC boot).
+
+SPL-alone SPI boot image::
+
+        ./tools/mkimage -n rk3399 -T rkspi -d spl/u-boot-spl.bin idbloader.img
+
+TPL+SPL SPI boot image::
+
+        ./tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img
+
+Copy SPI boot images into SD card and boot from SD::
+
+        sf probe
+        load mmc 1:1 $kernel_addr_r idbloader.img
+        sf erase 0 +$filesize
+        sf write $kernel_addr_r 0 ${filesize}
+        load mmc 1:1 ${kernel_addr_r} u-boot.itb
+        sf erase 0x60000 +$filesize
+        sf write $kernel_addr_r 0x60000 ${filesize}
+
 TODO
 ----
 
@@ -171,4 +195,4 @@ TODO
 - Add missing SoC's with it boards list
 
 .. Jagan Teki <jagan@amarulasolutions.com>
-.. Sunday 24 May 2020 10:08:41 PM IST
+.. Tuesday 02 June 2020 12:18:57 AM IST
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 1/4] Makefile: Drop to handle rkspi image type
  2020-06-04 14:51     ` Jagan Teki
@ 2020-06-04 14:55       ` Philipp Tomsich
  -1 siblings, 0 replies; 14+ messages in thread
From: Philipp Tomsich @ 2020-06-04 14:55 UTC (permalink / raw)
  To: Jagan Teki
  Cc: Kever Yang, Simon Glass, Hugh Cole-Baker, Suniel Mahesh,
	U-Boot-Denx, open list:ARM/Rockchip SoC...,
	linux-amarula, Heiko Stuebner, Christoph Müllner



> On 04.06.2020, at 16:51, Jagan Teki <jagan@amarulasolutions.com> wrote:
> 
> On rockchip platforms, SPI boot image creation is not
> straightforward like MMC boot image creation where former
> requires to specify tpl, spl in multimage format in mkimage,
> and later simply do a concatenate mkimaged-tpl with spl.
> 
> On this note, let drop rkspi image type creation via kbuild
> and let inform via rockchip.rst
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> Changes for v3:
> - none
> 
> Makefile | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 3851dd9fa0..db3b6b9991 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1438,22 +1438,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> 
> ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
> 
> -# rockchip image type
> -ifeq ($(CONFIG_SPL_SPI_LOAD),y)
> -ROCKCHIP_IMG_TYPE := rkspi
> -else
> -ROCKCHIP_IMG_TYPE := rksd
> -endif

This should not be either-or, but rather allow the creation of both a SPI and SD/eMMC image
for a platform, if so desired — e.g. the RK3399-Q7 supports both SPI and eMMC boot and it
is a user-choice which location will be used for the bootloader.

In other words: make this a “checkbox” option in Kconfig and output a rkspi, a rksd or both
images depending on what is selected.

Thanks,
Philipp.

> -
> # TPL + SPL
> ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
> -MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
> +MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
> tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
> 	$(call if_changed,mkimage)
> idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
> 	$(call if_changed,cat)
> else
> -MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
> +MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
> idbloader.img: spl/u-boot-spl.bin FORCE
> 	$(call if_changed,mkimage)
> endif
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 1/4] Makefile: Drop to handle rkspi image type
@ 2020-06-04 14:55       ` Philipp Tomsich
  0 siblings, 0 replies; 14+ messages in thread
From: Philipp Tomsich @ 2020-06-04 14:55 UTC (permalink / raw)
  To: u-boot



> On 04.06.2020, at 16:51, Jagan Teki <jagan@amarulasolutions.com> wrote:
> 
> On rockchip platforms, SPI boot image creation is not
> straightforward like MMC boot image creation where former
> requires to specify tpl, spl in multimage format in mkimage,
> and later simply do a concatenate mkimaged-tpl with spl.
> 
> On this note, let drop rkspi image type creation via kbuild
> and let inform via rockchip.rst
> 
> Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> Changes for v3:
> - none
> 
> Makefile | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 3851dd9fa0..db3b6b9991 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1438,22 +1438,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> 
> ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
> 
> -# rockchip image type
> -ifeq ($(CONFIG_SPL_SPI_LOAD),y)
> -ROCKCHIP_IMG_TYPE := rkspi
> -else
> -ROCKCHIP_IMG_TYPE := rksd
> -endif

This should not be either-or, but rather allow the creation of both a SPI and SD/eMMC image
for a platform, if so desired ? e.g. the RK3399-Q7 supports both SPI and eMMC boot and it
is a user-choice which location will be used for the bootloader.

In other words: make this a ?checkbox? option in Kconfig and output a rkspi, a rksd or both
images depending on what is selected.

Thanks,
Philipp.

> -
> # TPL + SPL
> ifeq ($(CONFIG_SPL)$(CONFIG_TPL),yy)
> -MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
> +MKIMAGEFLAGS_u-boot-tpl-rockchip.bin = -n $(CONFIG_SYS_SOC) -T rksd
> tpl/u-boot-tpl-rockchip.bin: tpl/u-boot-tpl.bin FORCE
> 	$(call if_changed,mkimage)
> idbloader.img: tpl/u-boot-tpl-rockchip.bin spl/u-boot-spl.bin FORCE
> 	$(call if_changed,cat)
> else
> -MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T $(ROCKCHIP_IMG_TYPE)
> +MKIMAGEFLAGS_idbloader.img = -n $(CONFIG_SYS_SOC) -T rksd
> idbloader.img: spl/u-boot-spl.bin FORCE
> 	$(call if_changed,mkimage)
> endif
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v3 1/4] Makefile: Drop to handle rkspi image type
  2020-06-04 14:55       ` Philipp Tomsich
@ 2020-06-04 15:08           ` Jagan Teki
  -1 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 15:08 UTC (permalink / raw)
  To: Philipp Tomsich
  Cc: Heiko Stuebner, U-Boot-Denx, linux-amarula, Simon Glass,
	Kever Yang, open list:ARM/Rockchip SoC...,
	Suniel Mahesh, Hugh Cole-Baker, Christoph Müllner

On Thu, Jun 4, 2020 at 8:25 PM Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
>
>
>
> > On 04.06.2020, at 16:51, Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > On rockchip platforms, SPI boot image creation is not
> > straightforward like MMC boot image creation where former
> > requires to specify tpl, spl in multimage format in mkimage,
> > and later simply do a concatenate mkimaged-tpl with spl.
> >
> > On this note, let drop rkspi image type creation via kbuild
> > and let inform via rockchip.rst
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> > ---
> > Changes for v3:
> > - none
> >
> > Makefile | 11 ++---------
> > 1 file changed, 2 insertions(+), 9 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 3851dd9fa0..db3b6b9991 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1438,22 +1438,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> >
> > ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
> >
> > -# rockchip image type
> > -ifeq ($(CONFIG_SPL_SPI_LOAD),y)
> > -ROCKCHIP_IMG_TYPE := rkspi
> > -else
> > -ROCKCHIP_IMG_TYPE := rksd
> > -endif
>
> This should not be either-or, but rather allow the creation of both a SPI and SD/eMMC image
> for a platform, if so desired — e.g. the RK3399-Q7 supports both SPI and eMMC boot and it
> is a user-choice which location will be used for the bootloader.
>
> In other words: make this a “checkbox” option in Kconfig and output a rkspi, a rksd or both
> images depending on what is selected.

Agree on the point that the build cannot create images when SPI or
both SPI/MMC enabled. I do have a patch to take care of that but the
SPI boot image creation in TPL-flow seems not building via Makefile.

./tools/mkimage -n rk3399 -T rkspi -d
tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img

Technically this patch allows us to build MMC boot image since it is a
default boot image requirement for most of the board.  And yes will
try to update Makefile once I have fixed the above problem with SPI
TPL-flow.

Jagan.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v3 1/4] Makefile: Drop to handle rkspi image type
@ 2020-06-04 15:08           ` Jagan Teki
  0 siblings, 0 replies; 14+ messages in thread
From: Jagan Teki @ 2020-06-04 15:08 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 4, 2020 at 8:25 PM Philipp Tomsich
<philipp.tomsich@theobroma-systems.com> wrote:
>
>
>
> > On 04.06.2020, at 16:51, Jagan Teki <jagan@amarulasolutions.com> wrote:
> >
> > On rockchip platforms, SPI boot image creation is not
> > straightforward like MMC boot image creation where former
> > requires to specify tpl, spl in multimage format in mkimage,
> > and later simply do a concatenate mkimaged-tpl with spl.
> >
> > On this note, let drop rkspi image type creation via kbuild
> > and let inform via rockchip.rst
> >
> > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
> > Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
> > ---
> > Changes for v3:
> > - none
> >
> > Makefile | 11 ++---------
> > 1 file changed, 2 insertions(+), 9 deletions(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 3851dd9fa0..db3b6b9991 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1438,22 +1438,15 @@ u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
> >
> > ifeq ($(CONFIG_ARCH_ROCKCHIP),y)
> >
> > -# rockchip image type
> > -ifeq ($(CONFIG_SPL_SPI_LOAD),y)
> > -ROCKCHIP_IMG_TYPE := rkspi
> > -else
> > -ROCKCHIP_IMG_TYPE := rksd
> > -endif
>
> This should not be either-or, but rather allow the creation of both a SPI and SD/eMMC image
> for a platform, if so desired ? e.g. the RK3399-Q7 supports both SPI and eMMC boot and it
> is a user-choice which location will be used for the bootloader.
>
> In other words: make this a ?checkbox? option in Kconfig and output a rkspi, a rksd or both
> images depending on what is selected.

Agree on the point that the build cannot create images when SPI or
both SPI/MMC enabled. I do have a patch to take care of that but the
SPI boot image creation in TPL-flow seems not building via Makefile.

./tools/mkimage -n rk3399 -T rkspi -d
tpl/u-boot-tpl.bin:spl/u-boot-spl.bin idbloader.img

Technically this patch allows us to build MMC boot image since it is a
default boot image requirement for most of the board.  And yes will
try to update Makefile once I have fixed the above problem with SPI
TPL-flow.

Jagan.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-06-04 15:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 14:51 [PATCH v3 0/4] rockchip: rk3399: Add SPI boot Jagan Teki
2020-06-04 14:51 ` Jagan Teki
     [not found] ` <20200604145141.356702-1-jagan-dyjBcgdgk7Pe9wHmmfpqLFaTQe2KTcn/@public.gmane.org>
2020-06-04 14:51   ` [PATCH v3 1/4] Makefile: Drop to handle rkspi image type Jagan Teki
2020-06-04 14:51     ` Jagan Teki
2020-06-04 14:55     ` Philipp Tomsich
2020-06-04 14:55       ` Philipp Tomsich
     [not found]       ` <56A28F79-EB4C-4091-A72D-F4CDF3B0F60F-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org>
2020-06-04 15:08         ` Jagan Teki
2020-06-04 15:08           ` Jagan Teki
2020-06-04 14:51   ` [PATCH v3 2/4] roc-rk3399-pc: Mark default env from SPI Jagan Teki
2020-06-04 14:51     ` Jagan Teki
2020-06-04 14:51   ` [PATCH v3 3/4] roc-rk3399-pc: Add SPI boot Jagan Teki
2020-06-04 14:51     ` Jagan Teki
2020-06-04 14:51   ` [PATCH v3 4/4] doc: rockchip: Document SPI flash program steps Jagan Teki
2020-06-04 14:51     ` Jagan Teki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.