Commit 67bb87f1 authored by Ye Li's avatar Ye Li Committed by Jason Liu

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: default avatarYe Li <ye.li@nxp.com>
Acked-by: default avatarPeng Fan <peng.fan@nxp.com>
parent 2c6209af
......@@ -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);
......
......@@ -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
......
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment