Making veyrons boot, 2020 edition
Subsystems (3)
cover Making veyrons boot, 2020 edition
Hi,
This is a series to make veyrons (tested on a veyron speedy), boot atleast to the u-boot prompt, the first 3 patches are necessary and the 4th one kinda just managed to catch this patch train ;)
PS. Thanks to swiftgeek on IRC for some bisecting & testing, thus getting me curious enough to investigate these myself.
Urja Rannikko (4):
rockchip: spl: veyron speedy boots from SPI
rockchip: veyron: move board_early_init_f to _r (after reloc)
rockchip: spl-boot-order: do not attempt to access fdt if OF_PLATDATA
defconfig: veyron: no need for CONFIG_SPL_PINCTRL_FULL
arch/arm/mach-rockchip/spl-boot-order.c | 6 ++++++ arch/arm/mach-rockchip/spl.c | 3 ++- board/google/veyron/veyron.c | 2 +- configs/chromebit_mickey_defconfig | 4 ++-- configs/chromebook_jerry_defconfig | 5 ++--- configs/chromebook_minnie_defconfig | 4 ++-- configs/chromebook_speedy_defconfig | 3 ++- 7 files changed, 17 insertions(+), 10 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/4 rockchip: spl: veyron speedy boots from SPI
Apparently speedy was forgotten from this list of veyron devices.
--- arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/spl.c +2 -1
@@ -49,7 +49,8 @@ u32 spl_boot_device(void)#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY ) || \ defined(CONFIG_TARGET_CHROMEBIT_MICKEY ) || \ - defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) + defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) || \ + defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY )return BOOT_DEVICE_SPI ;#endif if (CONFIG_IS_ENABLED (ROCKCHIP_BACK_TO_BROM ))
Signature · 1 line
2.26.2
PATCH 1/4 rockchip: spl: veyron speedy boots from SPI
Quoted 4 lines · Urja Rannikko
Apparently speedy was forgotten from this list of veyron devices.
Fixes 49105fb7ed ("rockchip: add common spl board file")Signed-off-by Urja Rannikko <[email protected]>
Thanks,
- Kever
Quoted 18 lines
--- arch/arm/mach-rockchip/spl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/arm/mach-rockchip/spl.c +2
-1@@ -49,7 +49,8 @@ u32 spl_boot_device(void)#if defined(CONFIG_TARGET_CHROMEBOOK_JERRY ) || \ defined(CONFIG_TARGET_CHROMEBIT_MICKEY ) || \ - defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) + defined(CONFIG_TARGET_CHROMEBOOK_MINNIE ) || \ + defined(CONFIG_TARGET_CHROMEBOOK_SPEEDY )return BOOT_DEVICE_SPI ;#endif if (CONFIG_IS_ENABLED (ROCKCHIP_BACK_TO_BROM ))
PATCH 2/4 rockchip: veyron: move board_early_init_f to _r (after reloc)
In reply to Urja RannikkoPreviously veyron_init() was called in board_init() context, which is called after relocation. Moving it to veyron.c used board_early_init_f which is called way earlier, and causes veyron_init to hang. Using board_early_init_r instead fixes this.
--- board/google/veyron/veyron.c | 2 +- configs/chromebit_mickey_defconfig | 1 + configs/chromebook_jerry_defconfig | 2 +- configs/chromebook_minnie_defconfig | 1 + configs/chromebook_speedy_defconfig | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-)
board/google/veyron/veyron.c +1 -1
@@ -68,7 +68,7 @@ static int veyron_init(void) }#endif -int board_early_init_f (void ) +int board_early_init_r (void ) {struct udevice *dev;int ret;
configs/chromebit_mickey_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-mickey.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
configs/chromebook_jerry_defconfig +1 -1
@@ -20,7 +20,7 @@ CONFIG_LOG=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-jerry.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
configs/chromebook_minnie_defconfig +1 -0
@@ -20,6 +20,7 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-minnie.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
configs/chromebook_speedy_defconfig +1 -1
@@ -20,7 +20,7 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-speedy.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
Signature · 1 line
2.26.2
PATCH 2/4 rockchip: veyron: move board_early_init_f to _r (after reloc)
Quoted 7 lines · Urja Rannikko
Previously
veyron_init()was called inboard_init()context, which is called after relocation. Moving it toveyron.cusedboard_early_init_fwhich is called way earlier, and causesveyron_initto hang. Usingboard_early_init_rinstead fixes this.Fixes b678f2790c ("rockchip: rk3288: Move veyron_init() back to veyron.c")Signed-off-by Urja Rannikko <[email protected]>
Thanks,
- Kever
Quoted 71 lines
--- board/google/veyron/veyron.c | 2 +- configs/chromebit_mickey_defconfig | 1 + configs/chromebook_jerry_defconfig | 2 +- configs/chromebook_minnie_defconfig | 1 + configs/chromebook_speedy_defconfig | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-)board/google/veyron/veyron.c +1
-1@@ -68,7 +68,7 @@ static int veyron_init(void) }#endif -int board_early_init_f (void ) +int board_early_init_r (void ) {struct udevice *dev;int ret;configs/chromebit_mickey_defconfig +1
-0@@ -19,6 +19,7 @@ CONFIG_USE_PREBOOT=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-mickey.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000configs/chromebook_jerry_defconfig +1
-1@@ -20,7 +20,7 @@ CONFIG_LOG=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-jerry.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000configs/chromebook_minnie_defconfig +1
-0@@ -20,6 +20,7 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-minnie.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000configs/chromebook_speedy_defconfig +1
-1@@ -20,7 +20,7 @@ CONFIG_SILENT_CONSOLE=y CONFIG_DEFAULT_FDT_FILE="rk3288-veyron-speedy.dtb" # CONFIG_DISPLAY_CPUINFO is not set CONFIG_DISPLAY_BOARDINFO_LATE=y -CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_BOARD_EARLY_INIT_R=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set CONFIG_SPL_STACK_R=y CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
PATCH 3/4 rockchip: spl-boot-order: do not attempt to access fdt if OF_PLATDATA
In reply to Urja Rannikkogd->fdt_blob is null if using OF_PLATDATA in SPL, which causes a hang after f0921f5098 ("fdt: Sync up to the latest libfdt").
We use the same test that is used in spl_common_init on whether to call fdtdec_setup to unconditionally avoid linking in the fdt-using code when not necessary and thus reduce SPL size.
--- arch/arm/mach-rockchip/spl-boot-order.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/mach-rockchip/spl-boot-order.c +6 -0
@@ -98,6 +98,12 @@ __weak const char *board_spl_was_booted_from(void)void board_boot_order (u32 *spl_boot_list) { +/* In case of no fdt (or only platdata), use spl_boot_device() */ +if (!CONFIG_IS_ENABLED (OF_CONTROL ) ||CONFIG_IS_ENABLED (OF_PLATDATA )) { + spl_boot_list[0 ] =spl_boot_device (); +return ; + } +const void *blob = gd->fdt_blob;int chosen_node =fdt_path_offset (blob,"/chosen" );int idx =0 ;
Signature · 1 line
2.26.2
PATCH 3/4 rockchip: spl-boot-order: do not attempt to access fdt if OF_PLATDATA
Quoted 7 lines · Urja Rannikko
gd->fdt_blobis null if usingOF_PLATDATAin SPL, which causes a hang afterf0921f5098("fdt: Sync up to the latest libfdt").
We use the same test that is used inspl_common_initon whether to callfdtdec_setupto unconditionally avoid linking in the fdt-using code when not necessary and thus reduce SPL size.Signed-off-by Urja Rannikko <[email protected]>
Thanks,
- Kever
Quoted 21 lines
--- arch/arm/mach-rockchip/spl-boot-order.c | 6 ++++++ 1 file changed, 6 insertions(+)arch/arm/mach-rockchip/spl-boot-order.c +6
-0@@ -98,6 +98,12 @@ __weak const char *board_spl_was_booted_from(void)void board_boot_order (u32 *spl_boot_list) { +/* In case of no fdt (or only platdata), use spl_boot_device() */ +if (!CONFIG_IS_ENABLED (OF_CONTROL ) ||CONFIG_IS_ENABLED (OF_PLATDATA )) { + spl_boot_list[0 ] =spl_boot_device (); +return ; + } +const void *blob = gd->fdt_blob;int chosen_node =fdt_path_offset (blob,"/chosen" );int idx =0 ;
PATCH 4/4 defconfig: veyron: no need for CONFIG_SPL_PINCTRL_FULL
In reply to Urja RannikkoVeyrons do not need full pinctrl support for SPL.
The full pinctrl support does nothing when enabled with OF_PLATDATA, thus was already unused.
This frees about 4kB of SPL size.
--- configs/chromebit_mickey_defconfig | 3 +-- configs/chromebook_jerry_defconfig | 3 +-- configs/chromebook_minnie_defconfig | 3 +-- configs/chromebook_speedy_defconfig | 1 + 4 files changed, 4 insertions(+), 6 deletions(-)
configs/chromebit_mickey_defconfig +1 -2
@@ -73,8 +73,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y -# CONFIG_SPL_PINMUX is not set -CONFIG_SPL_PINCONF=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=y
configs/chromebook_jerry_defconfig +1 -2
@@ -75,8 +75,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y -# CONFIG_SPL_PINMUX is not set -CONFIG_SPL_PINCONF=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=y
configs/chromebook_minnie_defconfig +1 -2
@@ -75,8 +75,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y -# CONFIG_SPL_PINMUX is not set -CONFIG_SPL_PINCONF=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=y
configs/chromebook_speedy_defconfig +1 -0
@@ -74,6 +74,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=y
Signature · 1 line
2.26.2
PATCH 4/4 defconfig: veyron: no need for CONFIG_SPL_PINCTRL_FULL
Quoted 6 lines · Urja Rannikko
Veyrons do not need full pinctrl support for SPL.
The full pinctrl support does nothing when enabled withOF_PLATDATA, thus was already unused.
This frees about 4kB of SPL size.Signed-off-by Urja Rannikko <[email protected]>
Thanks,
- Kever
Quoted 61 lines
--- configs/chromebit_mickey_defconfig | 3 +-- configs/chromebook_jerry_defconfig | 3 +-- configs/chromebook_minnie_defconfig | 3 +-- configs/chromebook_speedy_defconfig | 1 + 4 files changed, 4 insertions(+), 6 deletions(-)configs/chromebit_mickey_defconfig +1
-2@@ -73,8 +73,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y -# CONFIG_SPL_PINMUX is not set -CONFIG_SPL_PINCONF=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=yconfigs/chromebook_jerry_defconfig +1
-2@@ -75,8 +75,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y -# CONFIG_SPL_PINMUX is not set -CONFIG_SPL_PINCONF=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=yconfigs/chromebook_minnie_defconfig +1
-2@@ -75,8 +75,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y -# CONFIG_SPL_PINMUX is not set -CONFIG_SPL_PINCONF=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=yconfigs/chromebook_speedy_defconfig +1
-0@@ -74,6 +74,7 @@ CONFIG_SPI_FLASH_GIGADEVICE=y CONFIG_PINCTRL=y CONFIG_PINCONF=y CONFIG_SPL_PINCTRL=y +# CONFIG_SPL_PINCTRL_FULL is not set CONFIG_DM_PMIC=y # CONFIG_SPL_PMIC_CHILDREN is not set CONFIG_PMIC_RK8XX=y