Am335x uboot lights up LED
First briefly analyze the uboot startup process
Make am335x_evm, corresponding to boards.cfg:
Am335x_evm arm armv7 am335x ti am33xx am335x_evm:SERIAL1,CONS_INDEX=1
So the corresponding starting address is in the / arch/arm/cpu/armv7/start.S file.
Board level initialization initializes the peripheral pin setting in the s_init function.
A8_LED is connected to R6 of am335x, corresponding to the
MODE:7,GPIO2_25.
Define the module_pin_mux structure GPIO2_25
Static struct module_pin_mux GPIO2_25 [] = {{OFFSET (lcd_ac_bias_en), (MODE (7))}, / * LED * / {- 1},}
GPIO2_25 corresponds to serial number 32 "2" 25 = 89 to apply for access to GPIO2_25
Gpio_request (89, "led")
Set IO to output mode
Gpio_direction_output (89d0)
Set IO to low level and LED light on
Gpio_set_value (89d0)