Browse Source

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 <>
Acked-by: Peng Fan <>
(cherry picked from commit 0b454dac94)
Ye Li 3 years ago
3 changed files with 29 additions and 0 deletions
  1. +19
  2. +1
  3. +9

+ 19
- 0
arch/arm/cpu/armv8/imx8/cpu.c View File

@ -124,10 +124,23 @@ int print_cpuinfo(void)
#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);
sciErr = sc_pm_set_resource_power_mode(ipcHndl, SC_R_SMMU,

+ 1
- 0
arch/arm/include/asm/arch-imx8/imx-regs.h View File

@ -54,6 +54,7 @@
#define ROM_SW_INFO_ADDR 0x00000890
#define PASS_OVER_INFO_ADDR 0x0010fe00
#define USB_BASE_ADDR 0x5b0d0000
#define USB_PHY0_BASE_ADDR 0x5b100000

+ 9
- 0
arch/arm/include/asm/arch-imx8/sys_proto.h View File

@ -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);