diff options
author | zhang sanshan <sanshan.zhang@nxp.com> | 2017-05-10 10:14:27 +0800 |
---|---|---|
committer | Zhang Bo <bo.zhang@nxp.com> | 2017-06-21 12:21:03 +0800 |
commit | 81c9431f562bbeb2b6b1efb0f99e023ed818dc5d (patch) | |
tree | 8190ae0c64722f89dbcec4ad5c0874f41183b8e2 /board/freescale/mx6qsabreauto/mx6qsabreauto.c | |
parent | 31da76c496511b3d640ac1008b630b3ec939e168 (diff) | |
download | u-boot-imx-81c9431f562bbeb2b6b1efb0f99e023ed818dc5d.zip u-boot-imx-81c9431f562bbeb2b6b1efb0f99e023ed818dc5d.tar.gz u-boot-imx-81c9431f562bbeb2b6b1efb0f99e023ed818dc5d.tar.bz2 |
MA-9375 [Android IMX] uboot: enable BCB and bootctrl
* Add API to read\write MISC partition.
* get the boot mode from BCB command when boot up.
* get the boot up tactics from bootctrl.
Change-Id: Icbba6340e10983dddc1b04804ecc012a3a3c57d0
Signed-off-by: zhang sanshan <sanshan.zhang@nxp.com>
Diffstat (limited to 'board/freescale/mx6qsabreauto/mx6qsabreauto.c')
-rw-r--r-- | board/freescale/mx6qsabreauto/mx6qsabreauto.c | 93 |
1 files changed, 3 insertions, 90 deletions
diff --git a/board/freescale/mx6qsabreauto/mx6qsabreauto.c b/board/freescale/mx6qsabreauto/mx6qsabreauto.c index 159d9f3..1ea4185 100644 --- a/board/freescale/mx6qsabreauto/mx6qsabreauto.c +++ b/board/freescale/mx6qsabreauto/mx6qsabreauto.c @@ -1,5 +1,6 @@ /* * Copyright (C) 2012-2016 Freescale Semiconductor, Inc. + * Copyright 2017 NXP * * Author: Fabio Estevam <fabio.estevam@freescale.com> * @@ -1136,51 +1137,6 @@ int checkboard(void) } #ifdef CONFIG_FSL_FASTBOOT -void board_fastboot_setup(void) -{ - switch (get_boot_device()) { -#if defined(CONFIG_FASTBOOT_STORAGE_SATA) - case SATA_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "sata"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota sata"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_SATA*/ -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "nand"); - if (!getenv("fbparts")) - setenv("fbparts", ANDROID_FASTBOOT_NAND_PARTS); - if (!getenv("bootcmd")) - setenv("bootcmd", - "nand read ${loadaddr} ${boot_nand_offset} " - "${boot_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - default: - printf("unsupported boot devices\n"); - break; - } -} - #ifdef CONFIG_ANDROID_RECOVERY #define GPIO_VOL_DN_KEY IMX_GPIO_NR(5, 14) @@ -1188,12 +1144,9 @@ iomux_v3_cfg_t const recovery_key_pads[] = { (MX6_PAD_DISP0_DAT20__GPIO5_IO14 | MUX_PAD_CTRL(NO_PAD_CTRL)), }; -int check_recovery_cmd_file(void) +int is_recovery_key_pressing(void) { int button_pressed = 0; - int recovery_mode = 0; - - recovery_mode = recovery_check_and_clean_flag(); /* Check Recovery Combo Button press or not. */ imx_iomux_v3_setup_multiple_pads(recovery_key_pads, @@ -1207,49 +1160,9 @@ int check_recovery_cmd_file(void) printf("Recovery key pressed\n"); } - return recovery_mode || button_pressed; + return button_pressed; } -void board_recovery_setup(void) -{ - int bootdev = get_boot_device(); - - switch (bootdev) { -#if defined(CONFIG_FASTBOOT_STORAGE_SATA) - case SATA_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota sata recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_SATA*/ -#if defined(CONFIG_FASTBOOT_STORAGE_MMC) - case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; - case SD3_BOOT: - case MMC3_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 recovery"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ -#if defined(CONFIG_FASTBOOT_STORAGE_NAND) - case NAND_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", - "nand read ${loadaddr} ${recovery_nand_offset} " - "${recovery_nand_size};boota ${loadaddr}"); - break; -#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ - default: - printf("Unsupported bootup device for recovery: dev: %d\n", - bootdev); - return; - } - - printf("setup env for recovery..\n"); - setenv("bootcmd", "run bootcmd_android_recovery"); -} #endif /*CONFIG_ANDROID_RECOVERY*/ #endif /*CONFIG_FSL_FASTBOOT*/ |