rv1126: add iomux config for sd card boot

When the devices without firmware boot from the SD card,
the iomux of the storage interface is not configured,
so the firmware cannot be upgraded to the storage.
It needs to be configured by uboot.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: If3f4a0a37e37b2fc9e0f4d7e5869dbf156649505
This commit is contained in:
Yifeng Zhao 2021-02-06 09:45:32 +08:00
parent 1f161166c6
commit 5f10b8465d
2 changed files with 40 additions and 0 deletions

View File

@ -806,6 +806,24 @@ config GICV2
config GICV3
bool "ARM GICv3"
config ROCKCHIP_EMMC_IOMUX
bool "ROCKCHIP EMMC IOMUX"
default n
help
This enable U-Boot to config EMMC iomux.
config ROCKCHIP_NAND_IOMUX
bool "ROCKCHIP NAND IOMUX"
default n
help
This enable U-Boot to config NAND iomux.
config ROCKCHIP_SFC_IOMUX
bool "ROCKCHIP SFC IOMUX"
default n
help
This enable U-Boot to config SFC iomux.
source "arch/arm/mach-rockchip/px30/Kconfig"
source "arch/arm/mach-rockchip/rk3036/Kconfig"
source "arch/arm/mach-rockchip/rk3066/Kconfig"

View File

@ -683,6 +683,28 @@ int arch_cpu_init(void)
/* hold pmugrf's io reset */
writel(0x1 << 7 | 1 << 23, PMUGRF_SOC_CON1);
#else
/* uboot: config iomux for sd boot upgrade firmware */
#if defined(CONFIG_ROCKCHIP_SFC_IOMUX)
static struct rv1126_grf * const grf = (void *)GRF_BASE;
writel(0x0F0F0303, &grf->gpio0d_iomux_h);
writel(0xFFFF3333, &grf->gpio1a_iomux_l);
#elif defined(CONFIG_ROCKCHIP_EMMC_IOMUX)
static struct rv1126_grf * const grf = (void *)GRF_BASE;
writel(0xFFFF2222, &grf->gpio0c_iomux_h);
writel(0xFFFF2222, &grf->gpio0d_iomux_l);
writel(0xF0F02020, &grf->gpio0d_iomux_h);
#elif defined(CONFIG_ROCKCHIP_NAND_IOMUX)
static struct rv1126_grf * const grf = (void *)GRF_BASE;
writel(0xFFFF1111, &grf->gpio0c_iomux_h);
writel(0xFFFF1111, &grf->gpio0d_iomux_l);
writel(0xF0FF1011, &grf->gpio0d_iomux_h);
writel(0xFFFF1111, &grf->gpio1a_iomux_l);
#endif
#endif
#if defined(CONFIG_ROCKCHIP_SFC) && (defined(CONFIG_SPL_BUILD) || defined(CONFIG_SUPPORT_USBPLUG))