Skip to content
Snippets Groups Projects
Commit ca14f053 authored by Xuhui Lin's avatar Xuhui Lin Committed by chujin.zhou
Browse files

arm: rockchip: rv1103b: Use force_jtag to auto switch iomux


Change-Id: Ia827c85c4c3bf2d2dc4bf0da561a543a63beff95
Signed-off-by: default avatarXuhui Lin <xuhui.lin@rock-chips.com>
parent e04a8f61
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define GPIO1_IOC_GPIO1A_PULL_0 0x210
#define GPIO1_IOC_GPIO1A_PULL_1 0x10210
#define GPIO1_IOC_GPIO1B_PULL 0x10214
#define GPIO1_IOC_JTAG_M2_CON 0x10810
#define GPIO2_IOC_BASE 0x20840000
#define GPIO2A_IOMUX_SEL_1_1 0x44
......@@ -116,39 +117,6 @@ void board_set_iomux(enum if_type if_type, int devnum, int routing)
}
}
void board_unset_iomux(enum if_type if_type, int devnum, int routing)
{
switch (if_type) {
case IF_TYPE_MMC:
if (devnum == 0) {
/* EMMC -> GPIO */
writel(0xffff0000, GPIO1_IOC_BASE + GPIO1A_IOMUX_SEL_0);
writel(0x00ff0000, GPIO1_IOC_BASE + GPIO1A_IOMUX_SEL_1_0);
/* Pull down */
writel(0x0fff0000, GPIO1_IOC_BASE + GPIO1_IOC_GPIO1A_PULL_0);
} else if (devnum == 1) {
/* set SDMMC D0-3/CMD/CLK to jtag/gpio and pull down */
writel(0xf0000000, GPIO1_IOC_BASE + GPIO1A_IOMUX_SEL_1_1);
writel(0xffff3000, GPIO1_IOC_BASE + GPIO1B_IOMUX_SEL_0);
writel(0x000f0003, GPIO1_IOC_BASE + GPIO1B_IOMUX_SEL_1);
writel(0xc0008000, GPIO1_IOC_BASE + GPIO1_IOC_GPIO1A_PULL_1);
writel(0x03ff02AA, GPIO1_IOC_BASE + GPIO1_IOC_GPIO1B_PULL);
}
break;
case IF_TYPE_MTD:
if (routing == 0) {
/* FSPI0 M0 -> GPIO */
writel(0xffff0000, GPIO1_IOC_BASE + GPIO1A_IOMUX_SEL_0);
writel(0x00ff0000, GPIO1_IOC_BASE + GPIO1A_IOMUX_SEL_1_0);
/* Pull down */
writel(0x0c000000, GPIO1_IOC_BASE + GPIO1_IOC_GPIO1A_PULL_0);
}
break;
default:
printf("Bootdev 0x%x is not support unset iomux\n", if_type);
}
}
#ifdef CONFIG_SPL_BUILD
void rockchip_stimer_init(void)
{
......@@ -165,16 +133,6 @@ void rockchip_stimer_init(void)
writel(0x00010001, CONFIG_ROCKCHIP_STIMER_BASE + 0x4);
}
void spl_board_storages_fixup(struct spl_image_loader *loader)
{
if (!loader)
return;
if (loader->boot_device == BOOT_DEVICE_MMC2)
/* Unset the sdmmc0 iomux */
board_unset_iomux(IF_TYPE_MMC, 1, 0);
}
int spl_fit_standalone_release(char *id, uintptr_t entry_point)
{
if (!strcmp(id, "mcu0")) {
......@@ -229,9 +187,11 @@ int arch_cpu_init(void)
board_set_iomux(IF_TYPE_MTD, 0, 0);
#endif
#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_MMC_DW_ROCKCHIP)
#if defined(CONFIG_MMC_DW_ROCKCHIP)
/* Set the sdmmc iomux and power cycle */
board_set_iomux(IF_TYPE_MMC, 1, 0);
/* Enable force_jtag */
writel(0x00010001, GPIO1_IOC_BASE + GPIO1_IOC_JTAG_M2_CON);
#endif
/* no-secure WDT reset output will reset SoC system. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment