Tool/software:
Hello,
I take SDK 09_00_00_03 and I would like to read GPIO input in SPL, spl_mmc_load_image() at common/spl/spl_mmc.c.
I added below code to read GPIO0_64.
int spl_mmc_load_image(struct spl_image_info *spl_image, struct spl_boot_device *bootdev) { #if 1 unsigned long sw = 0, delay = 1000000; writel(0xF4104, 0x60007); while (delay--) {} sw = readl(0x00600070) & (1 << 0); if (sw == 0) { puts("*** TypeA Boot\n"); } else { puts("*** TypeB Boot\n"); } #endif
But SPL hung at writel() code.
Refer to other tickets, I think that the GPIO0 module is not running at this timing.
Is there a way to read GPIO pin in this timing?
Or I have to initialize GPIO0, power and clocks, manually?
Thank you