summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-09-01 05:26:58 -0500
committerYe Li <ye.li@nxp.com>2017-09-04 04:39:39 -0500
commit0b454dac9434aae891bc6b9c0dc179508d9d2fc1 (patch)
tree1f5fa837a02d181529f99fd36096351afe5cd4bf
parente4282def307c8d928397270c57d227a0a27cab62 (diff)
MLK-16361-1 imx8qm/qxp: Send boot status to SCFW if booted by SC ROM
We met u-boot hang when booting from eMMC fastboot on QM/QXP boards. The hang happens on u-boot accessing USB2 PHY for checking USB boot. The root cause is when putting AP image (u-boot-atf.bin) in first container, the USB2 PHY reset bit won’t be set in CONN SS by SCFW, because this SS has been powered on by SC ROM. In normal boot case, we won't meet such issue. Because we put u-boot-atf.bin in second container and AP ROM will boot up for loading this binary. When AP ROM completes the loading, it calls “misc_boot_status” API to power off the boot device and also power off the CONN SS. Then when u-boot enables any the module in CONN, the CONN SS will power on again by SCFW and set the USB2 PHY reset bit. Since the clock settings are different in SC ROM and SCFW, so it is suggested to power off CONN SS when booting is completed. In this patch, we check the g_ap_mu field in pass over structure which is used to pass into from SC ROM to AP ROM. This field is set only when AP image is included in the second container. If this field is not set, we suppose the booting only uses SC ROM, then u-boot calls "misc_boot_status" at early stage to power off boot device. Signed-off-by: Ye Li <ye.li@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/cpu/armv8/imx8/cpu.c19
-rw-r--r--arch/arm/include/asm/arch-imx8/imx-regs.h1
-rw-r--r--arch/arm/include/asm/arch-imx8/sys_proto.h9
3 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/imx8/cpu.c b/arch/arm/cpu/armv8/imx8/cpu.c
index 64af4b0caa..745bd8b3e5 100644
--- a/arch/arm/cpu/armv8/imx8/cpu.c
+++ b/arch/arm/cpu/armv8/imx8/cpu.c
@@ -124,10 +124,23 @@ int print_cpuinfo(void)
}
#endif
+#define BT_PASSOVER_TAG (0x504F)
+struct pass_over_info_t *get_pass_over_info(void)
+{
+ struct pass_over_info_t *p = (struct pass_over_info_t *)PASS_OVER_INFO_ADDR;
+
+ if (p->barker != BT_PASSOVER_TAG || p->len != sizeof(struct pass_over_info_t))
+ return NULL;
+
+ return p;
+}
+
int arch_cpu_init(void)
{
sc_ipc_t ipcHndl = 0;
sc_err_t sciErr = 0;
+ struct pass_over_info_t *pass_over;
+
gd->arch.ipc_channel_handle = 0;
/* Open IPC channel */
@@ -137,6 +150,12 @@ int arch_cpu_init(void)
gd->arch.ipc_channel_handle = ipcHndl;
+ pass_over = get_pass_over_info();
+ if (pass_over && pass_over->g_ap_mu == 0) {
+ /* When ap_mu is 0, means the u-boot is boot from first container */
+ sc_misc_boot_status(ipcHndl, SC_MISC_BOOT_STATUS_SUCCESS);
+ }
+
#ifdef CONFIG_IMX_SMMU
sciErr = sc_pm_set_resource_power_mode(ipcHndl, SC_R_SMMU,
SC_PM_PW_MODE_ON);
diff --git a/arch/arm/include/asm/arch-imx8/imx-regs.h b/arch/arm/include/asm/arch-imx8/imx-regs.h
index 53ba479218..e8a6d7d1c4 100644
--- a/arch/arm/include/asm/arch-imx8/imx-regs.h
+++ b/arch/arm/include/asm/arch-imx8/imx-regs.h
@@ -54,6 +54,7 @@
#define MXS_BCH_BASE (APBH_DMA_ARB_BASE_ADDR + 0x04000)
#define ROM_SW_INFO_ADDR 0x00000890
+#define PASS_OVER_INFO_ADDR 0x0010fe00
#define USB_BASE_ADDR 0x5b0d0000
#define USB_PHY0_BASE_ADDR 0x5b100000
diff --git a/arch/arm/include/asm/arch-imx8/sys_proto.h b/arch/arm/include/asm/arch-imx8/sys_proto.h
index caf3cdf832..0c3f69e618 100644
--- a/arch/arm/include/asm/arch-imx8/sys_proto.h
+++ b/arch/arm/include/asm/arch-imx8/sys_proto.h
@@ -38,6 +38,15 @@ struct rom_sw_info_t {
uint32_t rsvd[3];
};
+struct pass_over_info_t {
+ uint16_t barker;
+ uint16_t len;
+ uint32_t g_bt_cfg_shadow;
+ uint32_t card_address_mode;
+ uint32_t bad_block_count_met;
+ uint32_t g_ap_mu;
+};
+
int print_bootinfo(void);
int init_otg_power(void);
void power_off_pd_devices(const char* permanent_on_devices[], int size);