工具与软件:
您好!
我使用 SDK 09_00_00_03并想在 common/spl/spl_mc.c 下读取 SPL 中的 GPIO 输入 spl_mcu_load_image ()
我在下面添加了代码来读取 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
但 SPL 在 writel()代码挂起。
请参阅其他票证、我认为 GPIO0模块在此时序未运行。
在此时序中是否可以读取 GPIO 引脚?
或者我必须手动初始化 GPIO0、电源和时钟?
谢谢你