This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3874: Early read access of GPIO in bootloader phase

Part Number: AM3874

Hello,

 

We want to read the value of a GPIO (hardware distinction) in the bootloader RAWMLO of an AM387x and set various RAM parameters depending on the value.

Access to the GPIOs is currently only possible after initialising the RAM.

 

Is there a way to access the GPIOs before initialising the RAM or to set the RAM parameters again after reading a GPIO?


Thanks and regrads,

Chris

  • Hi Chris,
    AM3874x is not on the active support list in TI Linux SDK release.
    I'd give some general comments for your inquiry:
    - It is doable to enable GPIO in SPL code which is running from on-chip SRAM.
    - The new SPL code for GPIO has to be added to very early SPL code before sdram_init().
    - I'm uploading a patch file for adding early printf in the core board file (arch/arm/mach-omap2/am33xx/board.c) for AM335x
    with sample serial dump as listed below. This is for your reference on where to adding the new SPL code for GPIO access.
    - I'm also uploading a general SPL boot flow for your reference.

    <debug_uart> 
    Passed early_system_init()
     
    Passed board_early_init_f()
    
    Passed sdram_init()
    
    U-Boot SPL 2019.01-g175b3522cc-dirty (Jun 01 2021 - 22:47:04 -0500)
    Trying to boot from MMC1
    ...

    Best,

    -Hong

    2744.0001-SDK6.3-early-UART-print-enable-in-SPL-with-printf-ex.patch.txt
    From 60bbdb6643c170a4e5da07164492f19e6ccee5ab Mon Sep 17 00:00:00 2001
    From: [Hong Guan] <hguan@ti.com>
    Date: Thu, 13 Aug 2020 17:18:24 -0700
    Subject: [PATCH 1/1] SDK6.3 early UART print enable in SPL with printf example
    
    
    Signed-off-by: [Hong Guan] <hguan@ti.com>
    ---
     arch/arm/mach-omap2/am33xx/board.c |    3 +++
     configs/am43xx_evm_defconfig       |    7 +++++++
     2 files changed, 10 insertions(+), 0 deletions(-)
     mode change 100644 => 100755 arch/arm/mach-omap2/am33xx/board.c
     mode change 100644 => 100755 configs/am43xx_evm_defconfig
    
    diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
    old mode 100644
    new mode 100755
    index 62158a9..051a2b8
    --- a/arch/arm/mach-omap2/am33xx/board.c
    +++ b/arch/arm/mach-omap2/am33xx/board.c
    @@ -534,8 +534,11 @@ void board_init_f(ulong dummy)
     {
     	hw_data_init();
     	early_system_init();
    +	printf("\nPassed early_system_init()\n");
     	board_early_init_f();
    +	printf("\nPassed board_early_init_f()\n");
     	sdram_init();
    +	printf("\nPassed sdram_init()\n");
     	/* dram_init must store complete ramsize in gd->ram_size */
     	gd->ram_size = get_ram_size(
     			(void *)CONFIG_SYS_SDRAM_BASE,
    diff --git a/configs/am43xx_evm_defconfig b/configs/am43xx_evm_defconfig
    old mode 100644
    new mode 100755
    index 6272063..6b7afb0
    --- a/configs/am43xx_evm_defconfig
    +++ b/configs/am43xx_evm_defconfig
    @@ -12,6 +12,13 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1"
     CONFIG_SYS_CONSOLE_INFO_QUIET=y
     # CONFIG_MISC_INIT_R is not set
     CONFIG_VERSION_VARIABLE=y
    +# early UART
    +CONFIG_DEBUG_UART_BASE=0x44e09000
    +CONFIG_DEBUG_UART_CLOCK=48000000
    +CONFIG_DEBUG_UART=y
    +CONFIG_DEBUG_UART_OMAP=y
    +CONFIG_DEBUG_UART_SHIFT=2
    +CONFIG_DEBUG_UART_ANNOUNCE=y
     CONFIG_SPL_ETH_SUPPORT=y
     CONFIG_SPL_MTD_SUPPORT=y
     CONFIG_SPL_NET_SUPPORT=y
    -- 
    1.7.1
    
    

    0552.spl_boot_flow_v1.pdf