Commit 3d16389c909657a5fd1017e771ce5acf8aed6189
Committed by
Tom Rini
1 parent
73ec696059
Exists in
v2017.01-smarct4x
and in
25 other branches
board: am335x: Allow to choose serial device dynamically
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>
Showing 2 changed files with 15 additions and 0 deletions Side-by-side Diff
board/ti/am335x/board.c
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | #include <common.h> |
12 | 12 | #include <errno.h> |
13 | 13 | #include <spl.h> |
14 | +#include <serial.h> | |
14 | 15 | #include <asm/arch/cpu.h> |
15 | 16 | #include <asm/arch/hardware.h> |
16 | 17 | #include <asm/arch/omap.h> |
... | ... | @@ -58,6 +59,16 @@ |
58 | 59 | { |
59 | 60 | return ti_i2c_eeprom_am_get(-1, CONFIG_SYS_I2C_EEPROM_ADDR); |
60 | 61 | } |
62 | + | |
63 | +#ifndef CONFIG_DM_SERIAL | |
64 | +struct serial_device *default_serial_console(void) | |
65 | +{ | |
66 | + if (board_is_icev2()) | |
67 | + return &eserial4_device; | |
68 | + else | |
69 | + return &eserial1_device; | |
70 | +} | |
71 | +#endif | |
61 | 72 | |
62 | 73 | #ifndef CONFIG_SKIP_LOWLEVEL_INIT |
63 | 74 | static const struct ddr_data ddr2_data = { |
include/serial.h
... | ... | @@ -40,6 +40,10 @@ |
40 | 40 | |
41 | 41 | extern struct serial_device eserial1_device; |
42 | 42 | extern struct serial_device eserial2_device; |
43 | +extern struct serial_device eserial3_device; | |
44 | +extern struct serial_device eserial4_device; | |
45 | +extern struct serial_device eserial5_device; | |
46 | +extern struct serial_device eserial6_device; | |
43 | 47 | |
44 | 48 | extern void serial_register(struct serial_device *); |
45 | 49 | extern void serial_initialize(void); |