Tool/software:
I need two Lines on my Board, connected to Balls U14 and U15 to be actively set to LOW as soon as possible in the boot process.
With a simple SBL example (I actually edited the OTP keywriter app for the test), I can make this work super easy:
I added the GPIOs to the syscfg file:
... const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false); const gpio1 = gpio.addInstance(); const gpio2 = gpio.addInstance(); ... gpio1.$name = "CONFIG_GPIO1"; gpio1.pinDir = "OUTPUT"; gpio1.trigType = "RISE_EDGE"; gpio1.GPIO.$assign = "GPIO0"; gpio1.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO9"; gpio2.$name = "CONFIG_GPIO2"; gpio2.pinDir = "OUTPUT"; gpio2.trigType = "RISE_EDGE"; gpio2.GPIO.$assign = "GPIO0"; gpio2.GPIO.gpioPin.$assign = "PRG1_PRU0_GPO10"; ...
and then set the GPIO in the SBL code (again, since I used the OTP keywriter for the experiment, I simply added the code to the keywriter_setVpp() function):
#define TEST1_GPIO_BASE_ADDR (AddrTranslateP_getLocalAddr(CONFIG_GPIO1_BASE_ADDR)) // Get local address for GPIO1 #define TEST2_GPIO_BASE_ADDR (AddrTranslateP_getLocalAddr(CONFIG_GPIO2_BASE_ADDR)) // Get local address for GPIO2 void keywriter_setVpp(void) { uint32_t gpioBaseAddr1 = (uint32_t)TEST1_GPIO_BASE_ADDR; GPIO_setDirMode(gpioBaseAddr1, CONFIG_GPIO1_PIN, GPIO_DIRECTION_OUTPUT); GPIO_pinWriteLow(gpioBaseAddr1, CONFIG_GPIO1_PIN); uint32_t gpioBaseAddr2 = (uint32_t)TEST2_GPIO_BASE_ADDR; GPIO_setDirMode(gpioBaseAddr2, CONFIG_GPIO2_PIN, GPIO_DIRECTION_OUTPUT); GPIO_pinWriteLow(gpioBaseAddr2, CONFIG_GPIO2_PIN); }
compiled against the MCU+ SDK like the normal OTP keywriter SBL example.
This works fine and just as I need it to in the "real" scenario, which is the full normal u-boot chain.
My u-boot starts a custom standalone App which will do all of its own muxing, initializing and running of all hardware.
And during boot those two lines MUST stay LOW for the full boot until my App takes over.
I have a custom board config (defconfig, device trees, et al) based on the am64x-evm files from the 10.00.07.04 Linux SDK (board-support/ti-u-boot), but I cannot get the lines to behave like I want them to.
Please help me getting this to work properly.
I assume that I need to add the two Balls to the k3-am642-r5-<myboard>.dts
file and then set the value to LOW in e.g. the spl_board_init()
function? I can't get it to work.