diff options
author | Tony Lindgren <tony@atomide.com> | 2005-11-10 09:26:50 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-11-10 09:26:50 -0500 |
commit | 1a8bfa1eb998af6e650ad26201f7cae9f2a2fdc8 (patch) | |
tree | 1a9748171dbfe89a59e621009c32b5bb12d10f81 /arch/arm/plat-omap/common.c | |
parent | 3179a019391f0f8081245fd564a5f1be308ba64f (diff) |
[ARM] 3142/1: OMAP 2/5: Update files common to omap1 and omap2
Patch from Tony Lindgren
This patch syncs the mainline kernel with linux-omap tree.
The highlights of the patch are:
- Serial port and framebuffer init improvments by Imre Deak
- Common omap pin mux framework by Tony Lindgren
- Common omap clock framework by Tony Lindren
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/plat-omap/common.c')
-rw-r--r-- | arch/arm/plat-omap/common.c | 50 |
1 files changed, 37 insertions, 13 deletions
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 02bcc6c1cd1b..ccdb452630cf 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -31,7 +31,7 @@ | |||
31 | #include <asm/arch/mux.h> | 31 | #include <asm/arch/mux.h> |
32 | #include <asm/arch/fpga.h> | 32 | #include <asm/arch/fpga.h> |
33 | 33 | ||
34 | #include "clock.h" | 34 | #include <asm/arch/clock.h> |
35 | 35 | ||
36 | #define NO_LENGTH_CHECK 0xffffffff | 36 | #define NO_LENGTH_CHECK 0xffffffff |
37 | 37 | ||
@@ -117,19 +117,43 @@ EXPORT_SYMBOL(omap_get_var_config); | |||
117 | 117 | ||
118 | static int __init omap_add_serial_console(void) | 118 | static int __init omap_add_serial_console(void) |
119 | { | 119 | { |
120 | const struct omap_serial_console_config *info; | 120 | const struct omap_serial_console_config *con_info; |
121 | 121 | const struct omap_uart_config *uart_info; | |
122 | info = omap_get_config(OMAP_TAG_SERIAL_CONSOLE, | 122 | static char speed[11], *opt = NULL; |
123 | struct omap_serial_console_config); | 123 | int line, i, uart_idx; |
124 | if (info != NULL && info->console_uart) { | 124 | |
125 | static char speed[11], *opt = NULL; | 125 | uart_info = omap_get_config(OMAP_TAG_UART, struct omap_uart_config); |
126 | con_info = omap_get_config(OMAP_TAG_SERIAL_CONSOLE, | ||
127 | struct omap_serial_console_config); | ||
128 | if (uart_info == NULL || con_info == NULL) | ||
129 | return 0; | ||
130 | |||
131 | if (con_info->console_uart == 0) | ||
132 | return 0; | ||
133 | |||
134 | if (con_info->console_speed) { | ||
135 | snprintf(speed, sizeof(speed), "%u", con_info->console_speed); | ||
136 | opt = speed; | ||
137 | } | ||
126 | 138 | ||
127 | if (info->console_speed) { | 139 | uart_idx = con_info->console_uart - 1; |
128 | snprintf(speed, sizeof(speed), "%u", info->console_speed); | 140 | if (uart_idx >= OMAP_MAX_NR_PORTS) { |
129 | opt = speed; | 141 | printk(KERN_INFO "Console: external UART#%d. " |
130 | } | 142 | "Not adding it as console this time.\n", |
131 | return add_preferred_console("ttyS", info->console_uart - 1, opt); | 143 | uart_idx + 1); |
144 | return 0; | ||
145 | } | ||
146 | if (!(uart_info->enabled_uarts & (1 << uart_idx))) { | ||
147 | printk(KERN_ERR "Console: Selected UART#%d is " | ||
148 | "not enabled for this platform\n", | ||
149 | uart_idx + 1); | ||
150 | return -1; | ||
151 | } | ||
152 | line = 0; | ||
153 | for (i = 0; i < uart_idx; i++) { | ||
154 | if (uart_info->enabled_uarts & (1 << i)) | ||
155 | line++; | ||
132 | } | 156 | } |
133 | return 0; | 157 | return add_preferred_console("ttyS", line, opt); |
134 | } | 158 | } |
135 | console_initcall(omap_add_serial_console); | 159 | console_initcall(omap_add_serial_console); |