[U-Boot] [EXTERNAL] Re: [PATCH 1/1] Add UART base addresses for additional UARTs

Landheer-Cieslak, Ronald ronaldlandheercieslak at eaton.com
Wed Oct 25 15:54:51 UTC 2017


Hi Bin,

On Wednesday, October 25, 2017 10:45, Bin Meng wrote:
> On Wed, Oct 25, 2017 at 9:46 PM, Landheer-Cieslak, Ronald <ronaldlandheercieslak at eaton.com> wrote:
>> UARTs 1 through 5 were missing in the code - added.
>> Also pick the default according to the configuration setting for the 
>> console index.
>>
>> Signed-off-by: Ronald Landheer-Cieslak 
>> <ronaldlandheercieslak at eaton.com>
>> ---
>>  arch/arm/include/asm/arch-am33xx/hardware.h        | 14 +++++++++++++-
>>  arch/arm/include/asm/arch-am33xx/hardware_am33xx.h |  5 +++++
>>  2 files changed, 18 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/include/asm/arch-am33xx/hardware.h 
>> b/arch/arm/include/asm/arch-am33xx/hardware.h
>> index dd950e5..873098e 100644
>> --- a/arch/arm/include/asm/arch-am33xx/hardware.h
>> +++ b/arch/arm/include/asm/arch-am33xx/hardware.h
>> @@ -53,7 +53,19 @@
>>  #define DDR_CONTROL_BASE_ADDR          0x44E11404
>>
>>  /* UART */
>> -#define DEFAULT_UART_BASE              UART0_BASE
>> +#if CONFIG_CONS_INDEX == 1
>> +#      define DEFAULT_UART_BASE UART0_BASE
>> +#elif CONFIG_CONS_INDEX == 2
>> +#      define DEFAULT_UART_BASE UART1_BASE
>> +#elif CONFIG_CONS_INDEX == 3
>> +#      define DEFAULT_UART_BASE UART2_BASE
>> +#elif CONFIG_CONS_INDEX == 4
>> +#      define DEFAULT_UART_BASE UART3_BASE
>> +#elif CONFIG_CONS_INDEX == 5
>> +#      define DEFAULT_UART_BASE UART4_BASE
>> +#elif CONFIG_CONS_INDEX == 6
>> +#      define DEFAULT_UART_BASE UART5_BASE
>> +#endif
> Shouldn't these be in device tree?
The device tree isn't loaded at this point, so no: the boot needs to know where the UART registers are in order to use them, and needs to use the right ones according to its configuration.

The previous version of the code allowd board-specific code (i.e. board/<vendor>/<name>/*.c) to configure the pins as needed, but that didn't change the base address being used for the UART - just the pins. That means that if you have a board for which the uart0 pins are muxed elsewhere (i.e., in my case, an SPI bus), you have to change code outside of the board directory to get the boot loader to use the right UART.

With this patch in place, you'll no longer have to do that (your board-specific code just has to mux the pins correctly).

<snip/>

Regards,

Ronald


More information about the U-Boot mailing list