From 41a5d28743c67de411a0d723418f36589a224d1b Mon Sep 17 00:00:00 2001 From: Adrian Alonso Date: Wed, 7 Sep 2016 18:00:54 -0500 Subject: MLK-13130: configs: mx6qarm2: android lpddr2 pop support Add Android support for mx6qarm2 lpddr2 pop target Signed-off-by: Adrian Alonso (cherry picked from commit 6356f2b420f3571493755f6b3a307a66a539b60c) --- cmd/read.c | 2 +- configs/mx6qarm2android_pop_lpddr2_revb_defconfig | 45 ++++++++++++++ include/configs/mx6qarm2.h | 6 +- include/configs/mx6qarm2_android.h | 76 +++++++++++++++++++++++ scripts/config_whitelist.txt | 4 ++ 5 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 configs/mx6qarm2android_pop_lpddr2_revb_defconfig create mode 100644 include/configs/mx6qarm2_android.h diff --git a/cmd/read.c b/cmd/read.c index 61d8ce7..ecf9254 100644 --- a/cmd/read.c +++ b/cmd/read.c @@ -66,7 +66,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) return 1; } - if (blk_read(dev_desc, offset + blk, cnt, addr) < 0) { + if (blk_dread(dev_desc, offset + blk, cnt, addr) < 0) { printf("Error reading blocks\n"); return 1; } diff --git a/configs/mx6qarm2android_pop_lpddr2_revb_defconfig b/configs/mx6qarm2android_pop_lpddr2_revb_defconfig new file mode 100644 index 0000000..8468413 --- /dev/null +++ b/configs/mx6qarm2android_pop_lpddr2_revb_defconfig @@ -0,0 +1,45 @@ +CONFIG_ARM=y +CONFIG_ARCH_MX6=y +CONFIG_TARGET_MX6QARM2=y +CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6qarm2/mt128x64mx32.cfg,MX6Q,MX6DQ_POP_LPDDR2,DDR_MB=512" +CONFIG_FASTBOOT=y +CONFIG_EFI_PARTITION=y +CONFIG_BOOTDELAY=3 +CONFIG_BOARD_EARLY_INIT_F=y +CONFIG_HUSH_PARSER=y +CONFIG_CMD_BOOTZ=y +# CONFIG_CMD_IMLS is not set +# CONFIG_CMD_FLASH is not set +CONFIG_CMD_MEMTEST=y +CONFIG_CMD_MMC=y +CONFIG_CMD_USB=y +CONFIG_CMD_GPIO=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y +CONFIG_CMD_CACHE=y +CONFIG_CMD_EXT2=y +CONFIG_CMD_EXT4=y +CONFIG_CMD_EXT4_WRITE=y +CONFIG_CMD_FAT=y +CONFIG_CMD_FS_GENERIC=y +CONFIG_USB=y +CONFIG_USB_STORAGE=y +# CONFIG_OF_LIBFDT=y + +CONFIG_DEFAULT_DEVICE_TREE="imx6q-pop-arm2" +CONFIG_DEFAULT_FDT_FILE="imx6q-pop-arm2.dtb" +CONFIG_OF_CONTROL=y +# CONFIG_BLK is not set +CONFIG_DM_GPIO=y +CONFIG_DM_I2C=y +CONFIG_DM_MMC=y +# CONFIG_DM_MMC_OPS is not set +CONFIG_PINCTRL=y +CONFIG_PINCTRL_IMX6=y +CONFIG_DM_REGULATOR=y +CONFIG_DM_REGULATOR_FIXED=y +CONFIG_DM_REGULATOR_GPIO=y +CONFIG_DM_ETH=y +CONFIG_DM_USB=y diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h index f496be9..1edd300 100644 --- a/include/configs/mx6qarm2.h +++ b/include/configs/mx6qarm2.h @@ -152,4 +152,8 @@ #define CONFIG_USB_MAX_CONTROLLER_COUNT 1 #endif -#endif /* __CONFIG_H */ +#if defined(CONFIG_FASTBOOT) +#include "mx6qarm2_android.h" +#endif + +#endif /* __CONFIG_H */ diff --git a/include/configs/mx6qarm2_android.h b/include/configs/mx6qarm2_android.h new file mode 100644 index 0000000..3dc13bf --- /dev/null +++ b/include/configs/mx6qarm2_android.h @@ -0,0 +1,76 @@ +/* + * Copyright (C) 2013-2016 Freescale Semiconductor, Inc. All Rights Reserved. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef IMX6Q_ARM2_ANDROID_H +#define IMX6Q_ARM2_ANDROID_H + +#define CONFIG_CI_UDC +#define CONFIG_USBD_HS +#define CONFIG_USB_GADGET_DUALSPEED + +#define CONFIG_USB_GADGET +#define CONFIG_CMD_USB_MASS_STORAGE +#define CONFIG_USB_FUNCTION_MASS_STORAGE +#define CONFIG_USB_GADGET_DOWNLOAD +#define CONFIG_USB_GADGET_VBUS_DRAW 2 + +#define CONFIG_G_DNL_VENDOR_NUM 0x18d1 +#define CONFIG_G_DNL_PRODUCT_NUM 0x0d02 +#define CONFIG_G_DNL_MANUFACTURER "FSL" + +#define CONFIG_USB_FUNCTION_FASTBOOT +#define CONFIG_CMD_FASTBOOT +#define CONFIG_CMD_READ +#define CONFIG_BCB_SUPPORT +#define CONFIG_ANDROID_BOOT_IMAGE +#define CONFIG_FASTBOOT_FLASH + +/* For NAND we don't support lock/unlock */ +#ifndef CONFIG_SYS_BOOT_NAND +#define CONFIG_FASTBOOT_LOCK +#endif + +#define FSL_FASTBOOT_FB_DEV "mmc" +#define FSL_FASTBOOT_DATA_PART_NUM 4 +#define FSL_FASTBOOT_FB_PART_NUM 11 +#define FSL_FASTBOOT_PR_DATA_PART_NUM 12 + +#define CONFIG_FSL_CAAM_KB +#define CONFIG_CMD_FSL_CAAM_KB +#define CONFIG_SHA1 +#define CONFIG_SHA256 + +#define CONFIG_FSL_FASTBOOT +#define CONFIG_ANDROID_RECOVERY + +#if defined CONFIG_SYS_BOOT_NAND +#define CONFIG_FASTBOOT_STORAGE_NAND +#elif defined CONFIG_SYS_BOOT_SATA +#define CONFIG_FASTBOOT_STORAGE_SATA +#else +#define CONFIG_FASTBOOT_STORAGE_MMC +#endif + +#if defined(CONFIG_FASTBOOT_STORAGE_NAND) +#define ANDROID_FASTBOOT_NAND_PARTS "16m@64m(boot) 16m@80m(recovery) 810m@96m(android_root)ubifs" +#endif + +#define CONFIG_CMD_BOOTA +#define CONFIG_SUPPORT_RAW_INITRD +#define CONFIG_SERIAL_TAG + +#undef CONFIG_EXTRA_ENV_SETTINGS +#undef CONFIG_BOOTCOMMAND + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "splashpos=m,m\0" \ + "fdt_high=0xffffffff\0" \ + "initrd_high=0xffffffff\0" \ + +#define CONFIG_FASTBOOT_BUF_ADDR CONFIG_SYS_LOAD_ADDR +#define CONFIG_FASTBOOT_BUF_SIZE 0x19000000 + +#endif /* IMX6Q_ARM2_ANDROID_H */ diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 09f01a6..a2e2b28 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -226,6 +226,7 @@ CONFIG_BAT_CMD CONFIG_BAT_PAIR CONFIG_BAT_RW CONFIG_BAUDRATE +CONFIG_BCB_SUPPORT CONFIG_BCH CONFIG_BCH_CONST_M CONFIG_BCH_CONST_PARAMS @@ -488,6 +489,7 @@ CONFIG_CMD_FPGA_LOADBP CONFIG_CMD_FPGA_LOADFS CONFIG_CMD_FPGA_LOADMK CONFIG_CMD_FPGA_LOADP +CONFIG_CMD_FSL_CAAM_KB CONFIG_CMD_FUSE CONFIG_CMD_GETTIME CONFIG_CMD_GSC @@ -1066,6 +1068,7 @@ CONFIG_FACTORYSET CONFIG_FASTBOOT_FLASH_FILLBUF_SIZE CONFIG_FASTBOOT_FLASH_NAND_DEV CONFIG_FASTBOOT_FLASH_NAND_TRIMFFS +CONFIG_FASTBOOT_LOCK CONFIG_FAST_FLASH_BIT CONFIG_FAT_WRITE CONFIG_FB_ADDR @@ -1135,6 +1138,7 @@ CONFIG_FPGA_SPARTAN3 CONFIG_FPGA_STRATIX_V CONFIG_FPGA_ZYNQPL CONFIG_FSLDMAFEC +CONFIG_FSL_CAAM_KB CONFIG_FSL_CADMUS CONFIG_FSL_CORENET CONFIG_FSL_CPLD -- cgit v1.1