summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSanshan Zhang <sanshan.zhang@nxp.com>2017-01-25 09:13:35 +0800
committerSanshan Zhang <sanshan.zhang@nxp.com>2017-01-25 13:37:01 +0800
commit4c60cba3a017b921aebb84dd1268c898e549c99a (patch)
tree90dcdf948a328824953045d5fd47738c4f4c4c09 /arch
parentaa3e2f4dc91bdc2df22f208bad0cd24414fe8a63 (diff)
downloadu-boot-imx-4c60cba3a017b921aebb84dd1268c898e549c99a.zip
u-boot-imx-4c60cba3a017b921aebb84dd1268c898e549c99a.tar.gz
u-boot-imx-4c60cba3a017b921aebb84dd1268c898e549c99a.tar.bz2
MA-9213 imx: mx7ulp-evk: Add android support
Add android features on i.MX7ULP EVK board. Implement the code to get boot device and the serial number on mx7ulp. TODO: will add the code which check misc partition after porting BCB. Change-Id: I9d06fecba303fa4dfdcaf73da1b6246444697bba Signed-off-by: Sanshan Zhang <sanshan.zhang@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/cpu/armv7/mx7ulp/soc.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/mx7ulp/soc.c b/arch/arm/cpu/armv7/mx7ulp/soc.c
index 871dfcd..711fc75 100644
--- a/arch/arm/cpu/armv7/mx7ulp/soc.c
+++ b/arch/arm/cpu/armv7/mx7ulp/soc.c
@@ -10,6 +10,9 @@
#include <asm/arch/sys_proto.h>
#include <dm.h>
#include <asm/imx-common/hab.h>
+#ifdef CONFIG_FSL_FASTBOOT
+#include <asm/imx-common/boot_mode.h>
+#endif
#include <fdt_support.h>
struct lpuart_serial_platdata {
@@ -382,3 +385,64 @@ add:
return 0;
}
#endif
+
+
+#ifdef CONFIG_FSL_FASTBOOT
+enum boot_device get_boot_device(void)
+{
+ bool type;
+ u32 bt1_cfg = 0;
+ enum boot_device boot_dev = UNKNOWN_BOOT;
+
+ bt1_cfg = readl(CMC1_RBASE + 0x40);
+ type = (bt1_cfg >> 8) & 0x1;
+
+ if (type)
+ boot_dev = MMC1_BOOT;
+ else
+ boot_dev = SD1_BOOT;
+ return boot_dev;
+}
+#ifdef CONFIG_SERIAL_TAG
+void get_board_serial(struct tag_serialnr *serialnr)
+{
+
+ struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR;
+ struct fuse_bank *bank = &ocotp->bank[1];
+ struct fuse_bank1_regs *fuse =
+ (struct fuse_bank1_regs *)bank->fuse_regs;
+ serialnr->low = (fuse->cfg0 & 0xFFFF) + ((fuse->cfg1 & 0xFFFF) << 16);
+ serialnr->high = (fuse->cfg2 & 0xFFFF) + ((fuse->cfg3 & 0xFFFF) << 16);
+}
+#endif
+#ifdef CONFIG_ANDROID_RECOVERY
+/*
+ * check if the recovery filed is set by kernel, it can be set by kernel
+ * issue a command '# reboot recovery'
+ */
+int recovery_check_and_clean_flag(void)
+{
+/*
+ * TODO: will implement this part after porting BCB
+ */
+ return 0;
+}
+#endif /*CONFIG_ANDROID_RECOVERY*/
+/*
+ * check if the recovery field is set by kernel, it can be set by kernel
+ * issue a command '# reboot fastboot'
+ */
+int fastboot_check_and_clean_flag(void)
+{
+/*
+ * TODO: will implement this part after porting BCB
+ */
+ return 0;
+}
+void fastboot_enable_flag(void)
+{
+/*
+ * TODO: will implement this part after porting BCB
+ */
+}
+#endif /*CONFIG_FSL_FASTBOOT*/