[U-Boot] [PATCH v2 8/8] board: am335x: Allow to choose serial device dynamically

Tom Rini trini at konsulko.com
Tue May 17 02:41:54 CEST 2016


On Mon, May 16, 2016 at 11:47:29AM +0530, Lokesh Vutla wrote:

> Different AM335x based platforms have different serial consoles. As serial
> console is Kconfig option a separate defconfig has to be created for each
> platform. So pass the serial device dynamically.
> 
> Signed-off-by: Lokesh Vutla <lokeshvutla at ti.com>
> ---
> Changes since v1:
> - New patch.
>  board/ti/am335x/board.c | 11 +++++++++++
>  include/serial.h        |  4 ++++
>  2 files changed, 15 insertions(+)
> 
> diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
> index ff52314..56f4984 100644
> --- a/board/ti/am335x/board.c
> +++ b/board/ti/am335x/board.c
> @@ -11,6 +11,7 @@
>  #include <common.h>
>  #include <errno.h>
>  #include <spl.h>
> +#include <serial.h>
>  #include <asm/arch/cpu.h>
>  #include <asm/arch/hardware.h>
>  #include <asm/arch/omap.h>
> @@ -59,6 +60,16 @@ static inline int __maybe_unused read_eeprom(void)
>  	return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR);
>  }
>  
> +#ifndef CONFIG_DM_SERIAL
> +struct serial_device *default_serial_console(void)
> +{
> +	if (board_is_icev2())
> +		return &eserial4_device;
> +	else
> +		return &eserial1_device;
> +}
> +#endif
> +
>  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
>  static const struct ddr_data ddr2_data = {
>  	.datardsratio0 = MT47H128M16RT25E_RD_DQS,

... so in the DM case we're already handling this correctly?  Can't we
just say that ICEv2 is only supported with DM enabled so that we don't
need to add compat code that we'll remove rather soon (I hope..) ?
Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160516/35e591b5/attachment-0001.sig>


More information about the U-Boot mailing list