Commit 6ba004d34ead6c1341e1e6e5f5546df7deb06c65
1 parent
c5f8a46f6e
Exists in
smarc-imx-l5.0.0_1.0.0-ga
MLK-9652 Android: imx6sxsabreauto: Add android features support
Add android fastboot, recovery and booti support for mx6sx sabreauto board. Signed-off-by: Ye.Li <B37916@freescale.com>
Showing 4 changed files with 170 additions and 0 deletions Side-by-side Diff
board/freescale/mx6sxsabreauto/mx6sxsabreauto.c
... | ... | @@ -34,6 +34,13 @@ |
34 | 34 | #include <mxsfb.h> |
35 | 35 | #endif |
36 | 36 | |
37 | +#ifdef CONFIG_FASTBOOT | |
38 | +#include <fastboot.h> | |
39 | +#ifdef CONFIG_ANDROID_RECOVERY | |
40 | +#include <recovery.h> | |
41 | +#endif | |
42 | +#endif /*CONFIG_FASTBOOT*/ | |
43 | + | |
37 | 44 | DECLARE_GLOBAL_DATA_PTR; |
38 | 45 | |
39 | 46 | #define UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \ |
... | ... | @@ -884,4 +891,105 @@ |
884 | 891 | return 0; |
885 | 892 | } |
886 | 893 | #endif |
894 | + | |
895 | +#ifdef CONFIG_FASTBOOT | |
896 | + | |
897 | +void board_fastboot_setup(void) | |
898 | +{ | |
899 | + switch (get_boot_device()) { | |
900 | +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) | |
901 | + case SD3_BOOT: | |
902 | + case MMC3_BOOT: | |
903 | + if (!getenv("fastboot_dev")) | |
904 | + setenv("fastboot_dev", "mmc0"); | |
905 | + if (!getenv("bootcmd")) | |
906 | + setenv("bootcmd", "booti mmc0"); | |
907 | + break; | |
908 | + case SD4_BOOT: | |
909 | + case MMC4_BOOT: | |
910 | + if (!getenv("fastboot_dev")) | |
911 | + setenv("fastboot_dev", "mmc1"); | |
912 | + if (!getenv("bootcmd")) | |
913 | + setenv("bootcmd", "booti mmc1"); | |
914 | + break; | |
915 | +#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ | |
916 | +#if defined(CONFIG_FASTBOOT_STORAGE_NAND) | |
917 | + case NAND_BOOT: | |
918 | + if (!getenv("fastboot_dev")) | |
919 | + setenv("fastboot_dev", "nand"); | |
920 | + if (!getenv("fbparts")) | |
921 | + setenv("fbparts", | |
922 | + "16m@16m(boot) 16m@32m(recovery) 810m@48m(android_root)ubifs"); | |
923 | + if (!getenv("bootcmd")) | |
924 | + setenv("bootcmd", | |
925 | + "nand read ${loadaddr} ${boot_nand_offset} " | |
926 | + "${boot_nand_size};booti ${loadaddr}"); | |
927 | + break; | |
928 | +#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ | |
929 | + | |
930 | + default: | |
931 | + printf("unsupported boot devices\n"); | |
932 | + break; | |
933 | + } | |
934 | +} | |
935 | + | |
936 | +#ifdef CONFIG_ANDROID_RECOVERY | |
937 | +int check_recovery_cmd_file(void) | |
938 | +{ | |
939 | + int recovery_mode = 0; | |
940 | + | |
941 | + recovery_mode = recovery_check_and_clean_flag(); | |
942 | + | |
943 | + return recovery_mode; | |
944 | +} | |
945 | + | |
946 | +void board_recovery_setup(void) | |
947 | +{ | |
948 | + int bootdev = get_boot_device(); | |
949 | + | |
950 | + switch (bootdev) { | |
951 | +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) | |
952 | + case SD3_BOOT: | |
953 | + case MMC3_BOOT: | |
954 | + if (!getenv("bootcmd_android_recovery")) | |
955 | + setenv("bootcmd_android_recovery", "booti mmc0 recovery"); | |
956 | + break; | |
957 | + case SD4_BOOT: | |
958 | + case MMC4_BOOT: | |
959 | + if (!getenv("bootcmd_android_recovery")) | |
960 | + setenv("bootcmd_android_recovery", "booti mmc1 recovery"); | |
961 | + break; | |
962 | +#endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ | |
963 | +#if defined(CONFIG_FASTBOOT_STORAGE_NAND) | |
964 | + case NAND_BOOT: | |
965 | + if (!getenv("bootcmd_android_recovery")) | |
966 | + setenv("bootcmd_android_recovery", | |
967 | + "nand read ${loadaddr} ${recovery_nand_offset} " | |
968 | + "${recovery_nand_size};booti ${loadaddr}"); | |
969 | + break; | |
970 | +#endif /*CONFIG_FASTBOOT_STORAGE_NAND*/ | |
971 | + default: | |
972 | + printf("Unsupported bootup device for recovery: dev: %d\n", | |
973 | + bootdev); | |
974 | + return; | |
975 | + } | |
976 | + | |
977 | + printf("setup env for recovery..\n"); | |
978 | + setenv("bootcmd", "run bootcmd_android_recovery"); | |
979 | +} | |
980 | +#endif /*CONFIG_ANDROID_RECOVERY*/ | |
981 | + | |
982 | +#endif /*CONFIG_FASTBOOT*/ | |
983 | + | |
984 | +#ifdef CONFIG_IMX_UDC | |
985 | +iomux_v3_cfg_t const otg_udc_pads[] = { | |
986 | + (MX6SX_PAD_GPIO1_IO10__ANATOP_OTG1_ID | MUX_PAD_CTRL(NO_PAD_CTRL)), | |
987 | +}; | |
988 | +void udc_pins_setting(void) | |
989 | +{ | |
990 | + imx_iomux_v3_setup_multiple_pads(otg_udc_pads, | |
991 | + ARRAY_SIZE(otg_udc_pads)); | |
992 | +} | |
993 | + | |
994 | +#endif /*CONFIG_IMX_UDC*/ |
boards.cfg
... | ... | @@ -371,6 +371,8 @@ |
371 | 371 | Active arm armv7 mx6 freescale mx6sxsabreauto mx6sxsabreauto mx6sxsabreauto:IMX_CONFIG=board/freescale/mx6sxsabreauto/imximage.cfg,MX6SX Fabio Estevam <fabio.estevam@freescale.com> |
372 | 372 | Active arm armv7 mx6 freescale mx6sxsabreauto mx6sxsabreauto_qspi1 mx6sxsabreauto:IMX_CONFIG=board/freescale/mx6sxsabreauto/imximage.cfg,MX6SX,SYS_BOOT_QSPI Fabio Estevam <fabio.estevam@freescale.com> |
373 | 373 | Active arm armv7 mx6 freescale mx6sxsabreauto mx6sxsabreauto_nand mx6sxsabreauto:IMX_CONFIG=board/freescale/mx6sxsabreauto/imximage.cfg,MX6SX,SYS_BOOT_NAND Fabio Estevam <fabio.estevam@freescale.com> |
374 | +Active arm armv7 mx6 freescale mx6sxsabreauto mx6sxsabreautoandroid mx6sxsabreauto:IMX_CONFIG=board/freescale/mx6sxsabreauto/imximage.cfg,MX6SX,ANDROID_SUPPORT Fabio Estevam <fabio.estevam@freescale.com> | |
375 | +Active arm armv7 mx6 freescale mx6sxsabreauto mx6sxsabreautoandroid_nand mx6sxsabreauto:IMX_CONFIG=board/freescale/mx6sxsabreauto/imximage.cfg,MX6SX,SYS_BOOT_NAND,ANDROID_SUPPORT Fabio Estevam <fabio.estevam@freescale.com> | |
374 | 376 | Active arm armv7 mx6 gateworks gw_ventana gwventanadl gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6DL,DDR_MB=512 Tim Harvey <tharvey@gateworks.com> |
375 | 377 | Active arm armv7 mx6 gateworks gw_ventana gwventanadl1g gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6DL,DDR_MB=1024 Tim Harvey <tharvey@gateworks.com> |
376 | 378 | Active arm armv7 mx6 gateworks gw_ventana gwventanaq gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6Q,DDR_MB=512 Tim Harvey <tharvey@gateworks.com> |
include/configs/mx6sxsabreauto.h
include/configs/mx6sxsabreautoandroid.h
1 | + | |
2 | +/* | |
3 | + * Copyright (C) 2014 Freescale Semiconductor, Inc. | |
4 | + * | |
5 | + * SPDX-License-Identifier: GPL-2.0+ | |
6 | + */ | |
7 | + | |
8 | +#ifndef __MX6SX_SABREAUTO_ANDROID_H | |
9 | +#define __MX6SX_SABREAUTO_ANDROID_H | |
10 | + | |
11 | +#define CONFIG_SERIAL_TAG | |
12 | + | |
13 | +#define CONFIG_USB_DEVICE | |
14 | +#define CONFIG_IMX_UDC 1 | |
15 | + | |
16 | +#define CONFIG_FASTBOOT 1 | |
17 | +#define CONFIG_FASTBOOT_VENDOR_ID 0x18d1 | |
18 | +#define CONFIG_FASTBOOT_PRODUCT_ID 0x0d02 | |
19 | +#define CONFIG_FASTBOOT_BCD_DEVICE 0x311 | |
20 | +#define CONFIG_FASTBOOT_MANUFACTURER_STR "Freescale" | |
21 | +#define CONFIG_FASTBOOT_PRODUCT_NAME_STR "i.mx6sx SABRE-AUTO Board" | |
22 | +#define CONFIG_FASTBOOT_INTERFACE_STR "Android fastboot" | |
23 | +#define CONFIG_FASTBOOT_CONFIGURATION_STR "Android fastboot" | |
24 | +#define CONFIG_FASTBOOT_SERIAL_NUM "12345" | |
25 | +#define CONFIG_FASTBOOT_SATA_NO 0 | |
26 | + | |
27 | +#if defined CONFIG_SYS_BOOT_NAND | |
28 | +#define CONFIG_FASTBOOT_STORAGE_NAND | |
29 | +#else | |
30 | +#define CONFIG_FASTBOOT_STORAGE_MMC | |
31 | +#endif | |
32 | + | |
33 | +/* For system.img growing up more than 256MB, more buffer needs | |
34 | +* to receive the system.img*/ | |
35 | +#define CONFIG_FASTBOOT_TRANSFER_BUF 0x8c000000 | |
36 | +#define CONFIG_FASTBOOT_TRANSFER_BUF_SIZE 0x19000000 /* 400M byte */ | |
37 | + | |
38 | + | |
39 | +#define CONFIG_CMD_BOOTI | |
40 | +#define CONFIG_ANDROID_RECOVERY | |
41 | +/* which mmc bus is your main storage ? */ | |
42 | +#define CONFIG_ANDROID_MAIN_MMC_BUS 2 | |
43 | +#define CONFIG_ANDROID_BOOT_PARTITION_MMC 1 | |
44 | +#define CONFIG_ANDROID_SYSTEM_PARTITION_MMC 5 | |
45 | +#define CONFIG_ANDROID_RECOVERY_PARTITION_MMC 2 | |
46 | +#define CONFIG_ANDROID_CACHE_PARTITION_MMC 6 | |
47 | + | |
48 | +#undef CONFIG_EXTRA_ENV_SETTINGS | |
49 | +#undef CONFIG_BOOTCOMMAND | |
50 | + | |
51 | +#define CONFIG_EXTRA_ENV_SETTINGS \ | |
52 | + "splashpos=m,m\0" \ | |
53 | + "fdt_high=0xffffffff\0" \ | |
54 | + "initrd_high=0xffffffff\0" \ | |
55 | + | |
56 | +#endif |