Commit 4119e06dd8b971a258ecb2aa0461dc86da1ea725
1 parent
d12010b099
Exists in
v2017.01-smarct4x
and in
37 other branches
dm: am33xx: Provide platform data for serial
Provide suitable platform data for am33xx boards, so that these boards can use driver model for serial. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
Showing 1 changed file with 33 additions and 0 deletions Side-by-side Diff
arch/arm/cpu/armv7/am33xx/board.c
... | ... | @@ -11,6 +11,7 @@ |
11 | 11 | #include <common.h> |
12 | 12 | #include <dm.h> |
13 | 13 | #include <errno.h> |
14 | +#include <ns16550.h> | |
14 | 15 | #include <spl.h> |
15 | 16 | #include <asm/arch/cpu.h> |
16 | 17 | #include <asm/arch/hardware.h> |
... | ... | @@ -59,6 +60,38 @@ |
59 | 60 | { "gpio_omap", &am33xx_gpio[5] }, |
60 | 61 | #endif |
61 | 62 | }; |
63 | + | |
64 | +# ifndef CONFIG_OF_CONTROL | |
65 | +/* | |
66 | + * TODO(sjg@chromium.org): When we can move SPL serial to DM, we can remove | |
67 | + * the CONFIGs. At the same time, we should move this to the board files. | |
68 | + */ | |
69 | +static const struct ns16550_platdata am33xx_serial[] = { | |
70 | + { CONFIG_SYS_NS16550_COM1, 2, CONFIG_SYS_NS16550_CLK }, | |
71 | +# ifdef CONFIG_SYS_NS16550_COM2 | |
72 | + { CONFIG_SYS_NS16550_COM2, 2, CONFIG_SYS_NS16550_CLK }, | |
73 | +# ifdef CONFIG_SYS_NS16550_COM3 | |
74 | + { CONFIG_SYS_NS16550_COM3, 2, CONFIG_SYS_NS16550_CLK }, | |
75 | + { CONFIG_SYS_NS16550_COM4, 2, CONFIG_SYS_NS16550_CLK }, | |
76 | + { CONFIG_SYS_NS16550_COM5, 2, CONFIG_SYS_NS16550_CLK }, | |
77 | + { CONFIG_SYS_NS16550_COM6, 2, CONFIG_SYS_NS16550_CLK }, | |
78 | +# endif | |
79 | +# endif | |
80 | +}; | |
81 | + | |
82 | +U_BOOT_DEVICES(am33xx_uarts) = { | |
83 | + { "serial_omap", &am33xx_serial[0] }, | |
84 | +# ifdef CONFIG_SYS_NS16550_COM2 | |
85 | + { "serial_omap", &am33xx_serial[1] }, | |
86 | +# ifdef CONFIG_SYS_NS16550_COM3 | |
87 | + { "serial_omap", &am33xx_serial[2] }, | |
88 | + { "serial_omap", &am33xx_serial[3] }, | |
89 | + { "serial_omap", &am33xx_serial[4] }, | |
90 | + { "serial_omap", &am33xx_serial[5] }, | |
91 | +# endif | |
92 | +# endif | |
93 | +}; | |
94 | +# endif | |
62 | 95 | |
63 | 96 | #else |
64 | 97 |