diff options
author | Philippe Schenker <philippe.schenker@toradex.com> | 2020-08-18 13:50:17 +0200 |
---|---|---|
committer | Philippe Schenker <philippe.schenker@toradex.com> | 2020-08-20 14:04:47 +0200 |
commit | 04a3bde96d5ad5d04cc1f22016adb889a39c39f3 (patch) | |
tree | 896f47b237b9e081db27c83bf7a076e74e550910 | |
parent | fbdd85e70f0ff17cf9e742672c011173e16a782d (diff) |
board: apalis-imx8: order code differently for comparing reasons
So it is easier to compare to imx8qm-mek.c
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
-rw-r--r-- | board/toradex/apalis-imx8/apalis-imx8.c | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index bd7148ee30..920cff572f 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -128,34 +128,6 @@ int checkboard(void) return 0; } -int board_init(void) -{ -#ifdef CONFIG_MXC_GPIO - board_gpio_init(); -#endif - -#ifdef CONFIG_SNVS_SEC_SC_AUTO - { - int ret = snvs_security_sc_init(); - - if (ret) - return ret; - } -#endif - - return 0; -} - - -/* - * Board specific reset that is system reset. - */ -void reset_cpu(ulong addr) -{ - sc_pm_reboot(-1, SC_PM_RESET_TYPE_COLD); - while(1); -} - #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP) int ft_board_setup(void *blob, bd_t *bd) { @@ -163,11 +135,6 @@ int ft_board_setup(void *blob, bd_t *bd) } #endif -int mmc_map_to_kernel_blk(int dev_no) -{ - return dev_no; -} - static int check_mmc_autodetect(void) { char *autodetect_str = env_get("mmcautodetect"); @@ -236,42 +203,44 @@ static pcb_rev_t get_pcb_revision(void) } } -static void select_dt_from_module_version(void) +int board_init(void) { - char *fdt_env = env_get("fdtfile"); - - switch(get_pcb_revision()) { - case PCB_VERSION_1_0: - if (strcmp(FDT_FILE_V1_0, fdt_env)) { - env_set("fdtfile", FDT_FILE_V1_0); - printf("Detected a V1.0 module, setting " \ - "correct devicetree\n"); -#ifndef CONFIG_ENV_IS_NOWHERE - env_save(); +#ifdef CONFIG_MXC_GPIO + board_gpio_init(); #endif - } - break; - default: - break; + +#ifdef CONFIG_SNVS_SEC_SC_AUTO + { + int ret = snvs_security_sc_init(); + + if (ret) + return ret; } -} +#endif -static int do_select_dt_from_module_version(cmd_tbl_t *cmdtp, int flag, int argc, - char * const argv[]) { - select_dt_from_module_version(); return 0; } -U_BOOT_CMD( - select_dt_from_module_version, CONFIG_SYS_MAXARGS, 1, do_select_dt_from_module_version, - "\n", " - select devicetree from module version" -); + +/* + * Board specific reset that is system reset. + */ +void reset_cpu(ulong addr) +{ + sc_pm_reboot(-1, SC_PM_RESET_TYPE_COLD); + while(1); +} int board_mmc_get_env_dev(int devno) { return devno; } +int mmc_map_to_kernel_blk(int dev_no) +{ + return dev_no; +} + int board_late_init(void) { #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG @@ -313,3 +282,34 @@ int board_late_init(void) return 0; } + +static void select_dt_from_module_version(void) +{ + char *fdt_env = env_get("fdtfile"); + + switch(get_pcb_revision()) { + case PCB_VERSION_1_0: + if (strcmp(FDT_FILE_V1_0, fdt_env)) { + env_set("fdtfile", FDT_FILE_V1_0); + printf("Detected a V1.0 module, setting " \ + "correct devicetree\n"); +#ifndef CONFIG_ENV_IS_NOWHERE + env_save(); +#endif + } + break; + default: + break; + } +} + +static int do_select_dt_from_module_version(cmd_tbl_t *cmdtp, int flag, int argc, + char * const argv[]) { + select_dt_from_module_version(); + return 0; +} + +U_BOOT_CMD( + select_dt_from_module_version, CONFIG_SYS_MAXARGS, 1, do_select_dt_from_module_version, + "\n", " - select devicetree from module version" +); |