board: am335x: Allow to choose serial device dynamically
authorLokesh Vutla <lokeshvutla@ti.com>
Mon, 16 May 2016 06:17:29 +0000 (11:47 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 27 May 2016 19:47:54 +0000 (15:47 -0400)
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@ti.com>
board/ti/am335x/board.c
include/serial.h

index ff52314bf594d99c0c930672506c1f66a96e73d4..56f4984f479cafb90deeb74eb11ca540a5bc4b2d 100644 (file)
@@ -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,
index e490f9a0cf5e22945ddef399126c16f6e0be7281..47332c53406eb16b2226d1792c463ab6066fd396 100644 (file)
@@ -40,6 +40,10 @@ extern struct serial_device serial1_device;
 
 extern struct serial_device eserial1_device;
 extern struct serial_device eserial2_device;
+extern struct serial_device eserial3_device;
+extern struct serial_device eserial4_device;
+extern struct serial_device eserial5_device;
+extern struct serial_device eserial6_device;
 
 extern void serial_register(struct serial_device *);
 extern void serial_initialize(void);