Other Parts Discussed in Thread: AM625
Tool/software:
Hi
We would like to control gpio1_28 in uboot-10.01.10\arch\arm\mach-k3\am625_init.c void board_init_f(ulong dummy) but failed
Same code control gpio1_28 in uboot-10.01.10\board\ti\am62x\evm.c int board_late_init(void) is working good for us.
Is there anything we should done before using gpio1_28 in am625_init.c ?
We notice every first power on will failed, if we use cmd "reset" under uboot, both code will work.
#define BUZZFREQ_GPIO_PIN 120 /*EHRPWM2_A=GPIO1_28 92+28*/ gpio_request(BUZZFREQ_GPIO_PIN, "buzz_sound_freq"); long int i = 0; for(i=0; i<240;i++) { gpio_direction_output(BUZZFREQ_GPIO_PIN, 1); udelay(208); gpio_direction_output(BUZZFREQ_GPIO_PIN, 0); udelay(208); } gpio_free(BUZZFREQ_GPIO_PIN);
We also double checked gpio registers
===>>> init gpio state ===>>> read 0x00601018 GPIO_SET_DATA01=0x00000000 ===>>> read 0x0060101C GPIO_CLR_DATA01=0x00000000 ===>>> read 0x00601010 GPIO_DIR01=0xffffffff ===>>> read 0x00601014 GPIO_OUT_DATA01=0x00000000 ===>>> set gpio ON ===>>> read 0x00601018 GPIO_SET_DATA01=0x10000000 ===>>> read 0x0060101C GPIO_CLR_DATA01=0x10000000 ===>>> read 0x00601010 GPIO_DIR01=0xefffffff ===>>> read 0x00601014 GPIO_OUT_DATA01=0x10000000 ===>>> set gpio OFF ===>>> read 0x00601018 GPIO_SET_DATA01=0x00000000 ===>>> read 0x0060101C GPIO_CLR_DATA01=0x00000000 ===>>> read 0x00601010 GPIO_DIR01=0xefffffff ===>>> read 0x00601014 GPIO_OUT_DATA01=0x00000000
Regards,
Scott