-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: build u-boot spi image for rockpi
Build u-boot SPI image for rockpi Remove unused files and update rk3399m0 bins Signed-off-by: Noel Georgi <git@frezbo.dev>
- Loading branch information
Showing
6 changed files
with
214 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
152 changes: 152 additions & 0 deletions
152
u-boot/rockpi4/patches/board-rock-pi-4-enable-spi-flash.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/board-rock-pi-4-enable-spi-flash.patch | ||
diff --git a/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi b/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi | ||
index c17e769f..30f977db 100644 | ||
--- a/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi | ||
+++ b/arch/arm/dts/rk3399-rock-pi-4-u-boot.dtsi | ||
@@ -8,7 +7,27 @@ | ||
|
||
/ { | ||
chosen { | ||
- u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; | ||
+ u-boot,spl-boot-order = "same-as-spl", &spi_flash, &sdmmc, &sdhci; | ||
+ }; | ||
+ | ||
+ config { | ||
+ u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */ | ||
+ }; | ||
+}; | ||
+ | ||
+&spi1 { | ||
+ status = "okay"; | ||
+ | ||
+ flash@0 { | ||
+ compatible = "jedec,spi-nor"; | ||
+ reg = <0>; | ||
+ spi-max-frequency = <10000000>; | ||
+ }; | ||
+}; | ||
+ | ||
+&spi1 { | ||
+ spi_flash: flash@0 { | ||
+ u-boot,dm-pre-reloc; | ||
}; | ||
}; | ||
|
||
diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig | ||
index 764e2b56..11b57434 100644 | ||
--- a/configs/rock-pi-4-rk3399_defconfig | ||
+++ b/configs/rock-pi-4-rk3399_defconfig | ||
@@ -2,12 +2,16 @@ CONFIG_ARM=y | ||
CONFIG_ARCH_ROCKCHIP=y | ||
CONFIG_SYS_TEXT_BASE=0x00200000 | ||
CONFIG_NR_DRAM_BANKS=1 | ||
+CONFIG_ENV_SIZE=0x6000 | ||
CONFIG_ENV_OFFSET=0x3F8000 | ||
+CONFIG_ENV_SECT_SIZE=0x1000 | ||
CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-pi-4b" | ||
CONFIG_ROCKCHIP_RK3399=y | ||
CONFIG_TARGET_EVB_RK3399=y | ||
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_ANDROID_BOOT_IMAGE is not set | ||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4b.dtb" | ||
@@ -16,6 +20,7 @@ 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_CMD_BOOTZ=y | ||
CONFIG_CMD_GPT=y | ||
@@ -26,8 +31,9 @@ CONFIG_CMD_USB=y | ||
CONFIG_CMD_TIME=y | ||
CONFIG_SPL_OF_CONTROL=y | ||
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_SPL_DM_SEQ_ALIAS=y | ||
CONFIG_ROCKCHIP_GPIO=y | ||
CONFIG_SYS_I2C_ROCKCHIP=y | ||
CONFIG_MISC=y | ||
@@ -35,6 +41,10 @@ CONFIG_MMC_DW=y | ||
CONFIG_MMC_DW_ROCKCHIP=y | ||
CONFIG_MMC_SDHCI=y | ||
CONFIG_MMC_SDHCI_ROCKCHIP=y | ||
+CONFIG_SF_DEFAULT_BUS=1 | ||
+CONFIG_SPI_FLASH_GIGADEVICE=y | ||
+CONFIG_SPI_FLASH_WINBOND=y | ||
+CONFIG_SPI_FLASH_XTX=y | ||
CONFIG_DM_ETH=y | ||
CONFIG_ETH_DESIGNWARE=y | ||
CONFIG_GMAC_ROCKCHIP=y | ||
@@ -50,6 +60,7 @@ CONFIG_RAM_RK3399_LPDDR4=y | ||
CONFIG_DM_RESET=y | ||
CONFIG_BAUDRATE=1500000 | ||
CONFIG_DEBUG_UART_SHIFT=2 | ||
+CONFIG_ROCKCHIP_SPI=y | ||
CONFIG_SYSRESET=y | ||
CONFIG_USB=y | ||
CONFIG_USB_XHCI_HCD=y | ||
diff --git a/configs/rock-pi-4c-rk3399_defconfig b/configs/rock-pi-4c-rk3399_defconfig | ||
index 671c0c10..874f4061 100644 | ||
--- a/configs/rock-pi-4c-rk3399_defconfig | ||
+++ b/configs/rock-pi-4c-rk3399_defconfig | ||
@@ -2,12 +2,16 @@ CONFIG_ARM=y | ||
CONFIG_ARCH_ROCKCHIP=y | ||
CONFIG_SYS_TEXT_BASE=0x00200000 | ||
CONFIG_NR_DRAM_BANKS=1 | ||
+CONFIG_ENV_SIZE=0x6000 | ||
CONFIG_ENV_OFFSET=0x3F8000 | ||
+CONFIG_ENV_SECT_SIZE=0x1000 | ||
CONFIG_DEFAULT_DEVICE_TREE="rk3399-rock-pi-4c" | ||
CONFIG_ROCKCHIP_RK3399=y | ||
CONFIG_TARGET_EVB_RK3399=y | ||
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_ANDROID_BOOT_IMAGE is not set | ||
CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-rock-pi-4c.dtb" | ||
@@ -16,6 +20,7 @@ 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_CMD_BOOTZ=y | ||
CONFIG_CMD_GPT=y | ||
@@ -26,8 +31,9 @@ CONFIG_CMD_USB=y | ||
CONFIG_CMD_TIME=y | ||
CONFIG_SPL_OF_CONTROL=y | ||
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_SPL_DM_SEQ_ALIAS=y | ||
CONFIG_ROCKCHIP_GPIO=y | ||
CONFIG_SYS_I2C_ROCKCHIP=y | ||
CONFIG_MISC=y | ||
@@ -35,6 +41,10 @@ CONFIG_MMC_DW=y | ||
CONFIG_MMC_DW_ROCKCHIP=y | ||
CONFIG_MMC_SDHCI=y | ||
CONFIG_MMC_SDHCI_ROCKCHIP=y | ||
+CONFIG_SF_DEFAULT_BUS=1 | ||
+CONFIG_SPI_FLASH_GIGADEVICE=y | ||
+CONFIG_SPI_FLASH_WINBOND=y | ||
+CONFIG_SPI_FLASH_XTX=y | ||
CONFIG_DM_ETH=y | ||
CONFIG_ETH_DESIGNWARE=y | ||
CONFIG_GMAC_ROCKCHIP=y | ||
@@ -50,6 +60,7 @@ CONFIG_RAM_RK3399_LPDDR4=y | ||
CONFIG_DM_RESET=y | ||
CONFIG_BAUDRATE=1500000 | ||
CONFIG_DEBUG_UART_SHIFT=2 | ||
+CONFIG_ROCKCHIP_SPI=y | ||
CONFIG_SYSRESET=y | ||
CONFIG_USB=y | ||
CONFIG_USB_XHCI_HCD=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# this patch was missing from https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/board-rock-pi-4-enable-spi-flash.patch | ||
# and prevented booting from SPI | ||
diff --git a/configs/rock-pi-4-rk3399_defconfig b/configs/rock-pi-4-rk3399_defconfig | ||
index 2889a7f3ea..f963ec6910 100644 | ||
--- a/configs/rock-pi-4-rk3399_defconfig | ||
+++ b/configs/rock-pi-4-rk3399_defconfig | ||
@@ -11,6 +11,7 @@ CONFIG_ROCKCHIP_RK3399=y | ||
CONFIG_TARGET_EVB_RK3399=y | ||
CONFIG_DEBUG_UART_BASE=0xFF1A0000 | ||
CONFIG_DEBUG_UART_CLOCK=24000000 | ||
+CONFIG_SPL_SPI=y | ||
CONFIG_SPL_SPI_FLASH_SUPPORT=y | ||
CONFIG_SPL_SPI_SUPPORT=y | ||
CONFIG_DEBUG_UART=y |
34 changes: 34 additions & 0 deletions
34
u-boot/rockpi4/patches/general-add-xtx-spi-nor-chips.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# https://github.com/armbian/build/blob/09e416e31cc01ece4533a65f02a470a4c21b90ea/patch/u-boot/u-boot-rockchip64/general-add-xtx-spi-nor-chips.patch | ||
diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig | ||
index 018e8c59..8b0033b8 100644 | ||
--- a/drivers/mtd/spi/Kconfig | ||
+++ b/drivers/mtd/spi/Kconfig | ||
@@ -152,6 +152,12 @@ config SPI_FLASH_XMC | ||
Add support for various XMC (Wuhan Xinxin Semiconductor | ||
Manufacturing Corp.) SPI flash chips (XM25xxx) | ||
|
||
+config SPI_FLASH_XTX | ||
+ bool "XTX SPI flash support" | ||
+ help | ||
+ Add support for various XTX (Shenzhen Xin Tian Xia Tech) | ||
+ SPI flash chips (XM25xxx) | ||
+ | ||
endif | ||
|
||
config SPI_FLASH_USE_4K_SECTORS | ||
diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c | ||
index 114ebacd..3526a20b 100644 | ||
--- a/drivers/mtd/spi/spi-nor-ids.c | ||
+++ b/drivers/mtd/spi/spi-nor-ids.c | ||
@@ -319,6 +319,11 @@ const struct flash_info spi_nor_ids[] = { | ||
/* XMC (Wuhan Xinxin Semiconductor Manufacturing Corp.) */ | ||
{ INFO("XM25QH64A", 0x207017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, | ||
{ INFO("XM25QH128A", 0x207018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, | ||
+#endif | ||
+#ifdef CONFIG_SPI_FLASH_XTX | ||
+ /* XTX (Shenzhen Xin Tian Xia Tech) */ | ||
+ { INFO("XT25F32B", 0x0b4016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, | ||
+ { INFO("XT25F128B", 0x0b4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, | ||
#endif | ||
{ }, | ||
}; |