diff options
-rwxr-xr-x | board/technexion/pico-imx7d/pico-imx7d.c | 93 | ||||
-rw-r--r-- | configs/pico-imx7d_defconfig | 2 | ||||
-rwxr-xr-x | include/configs/pico-imx7d.h | 22 |
3 files changed, 116 insertions, 1 deletions
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 245b2b8..0f6b2e1 100755 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -36,6 +36,14 @@ #include <mxsfb.h> #endif +#ifdef CONFIG_FSL_FASTBOOT +#include <fsl_fastboot.h> +#ifdef CONFIG_ANDROID_RECOVERY +#include <recovery.h> +#endif +#endif /*CONFIG_FSL_FASTBOOT*/ + + DECLARE_GLOBAL_DATA_PTR; @@ -674,3 +682,88 @@ int board_ehci_hcd_init(int port) } #endif +#ifdef CONFIG_FSL_FASTBOOT + +void board_fastboot_setup(void) +{ + switch (get_boot_device()) { +#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 SD2_BOOT: + case MMC2_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 +int is_recovery_key_pressing(void) +{ + /* No key defined for this board */ + return 0; +} + +void board_recovery_setup(void) +{ + int bootdev = get_boot_device(); + + switch (bootdev) { +#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 SD2_BOOT: + case MMC2_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*/ diff --git a/configs/pico-imx7d_defconfig b/configs/pico-imx7d_defconfig index d38d510..26aecde 100644 --- a/configs/pico-imx7d_defconfig +++ b/configs/pico-imx7d_defconfig @@ -1,4 +1,4 @@ -CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/technexion/pico-imx7d/imximage.cfg,MX7D" +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/technexion/pico-imx7d/imximage.cfg,MX7D,ANDROID_SUPPORT,BRILLO_SUPPORT,EFI_PARTITION,AVB_SUPPORT" CONFIG_ARM=y CONFIG_TARGET_PICO_IMX7D=y CONFIG_SYS_MALLOC_F=y diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h index 7f5fb77..ba41d0b 100755 --- a/include/configs/pico-imx7d.h +++ b/include/configs/pico-imx7d.h @@ -19,6 +19,7 @@ #define CONFIG_SYS_GENERIC_BOARD #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO +#define CONFIG_SYS_BOOTM_LEN 0x1000000 #define CONFIG_DBG_MONITOR /* uncomment for PLUGIN mode support */ @@ -39,7 +40,11 @@ #define CONFIG_REVISION_TAG /* Size of malloc() pool */ +#ifdef CONFIG_AVB_SUPPORT #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M) +#else +#define CONFIG_SYS_MALLOC_LEN (16 * SZ_1M) +#endif #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT @@ -72,6 +77,10 @@ #define PHYS_SDRAM_SIZE SZ_1G +#ifdef CONFIG_AVB_SUPPORT +#define CONFIG_PARTITION_UUIDS +#endif + #define CONFIG_CMD_PING #define CONFIG_CMD_DHCP #define CONFIG_CMD_MII @@ -442,4 +451,17 @@ #if defined(CONFIG_ANDROID_SUPPORT) #include "mx7dsabresdandroid.h" #endif + +#if defined(CONFIG_BRILLO_SUPPORT) +#include "mx7dsabresdbrillo.h" +#endif + +#ifdef CONFIG_USB_FASTBOOT_BUF_SIZE +#undef CONFIG_USB_FASTBOOT_BUF_SIZE +#define CONFIG_USB_FASTBOOT_BUF_SIZE 0xc800000 +#endif + +#define PRODUCT_NAME "imx7d_pico" + + #endif /* __CONFIG_H */ |