Skip to content

Commit 4eae48b

Browse files
committed
ayufan: rock64: add board_init_sdmmc_pwr_en to configure iomux in SPL mode
1 parent 05a8e06 commit 4eae48b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

arch/arm/mach-rockchip/rk3328-board-spl.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,34 @@
1818
#include <asm/arch/periph.h>
1919
#include <asm/arch/timer.h>
2020

21+
#define GRF_BASE 0xFF100000
22+
2123
DECLARE_GLOBAL_DATA_PTR;
2224

2325
void board_debug_uart_init(void)
2426
{
2527
}
2628

29+
void board_init_sdmmc_pwr_en(void)
30+
{
31+
struct rk3328_grf_regs * const grf = (void *)GRF_BASE;
32+
33+
printf("board_init_sdmmc_pwr_en\n");
34+
35+
rk_clrsetreg(&grf->com_iomux,
36+
IOMUX_SEL_SDMMC_MASK,
37+
IOMUX_SEL_SDMMC_M1 << IOMUX_SEL_SDMMC_SHIFT);
38+
39+
rk_clrsetreg(&grf->gpio0d_iomux,
40+
GPIO0D6_SEL_MASK,
41+
GPIO0D6_GPIO << GPIO0D6_SEL_SHIFT);
42+
43+
rk_clrsetreg(&grf->gpio1a_iomux,
44+
GPIO1A0_SEL_MASK,
45+
GPIO1A0_CARD_DATA_CLK_CMD_DETN
46+
<< GPIO1A0_SEL_SHIFT);
47+
}
48+
2749
void board_init_f(ulong dummy)
2850
{
2951
struct udevice *dev;
@@ -36,6 +58,7 @@ void board_init_f(ulong dummy)
3658
}
3759

3860
preloader_console_init();
61+
board_init_sdmmc_pwr_en();
3962

4063
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
4164
if (ret) {

0 commit comments

Comments
 (0)