diff options
Diffstat (limited to 'arch/arm/plat-omap/common.c')
-rw-r--r-- | arch/arm/plat-omap/common.c | 95 |
1 files changed, 2 insertions, 93 deletions
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index ebcf006406f9..3a4768d55895 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c | |||
@@ -54,50 +54,6 @@ static const void *get_config(u16 tag, size_t len, int skip, size_t *len_out) | |||
54 | struct omap_board_config_kernel *kinfo = NULL; | 54 | struct omap_board_config_kernel *kinfo = NULL; |
55 | int i; | 55 | int i; |
56 | 56 | ||
57 | #ifdef CONFIG_OMAP_BOOT_TAG | ||
58 | struct omap_board_config_entry *info = NULL; | ||
59 | |||
60 | if (omap_bootloader_tag_len > 4) | ||
61 | info = (struct omap_board_config_entry *) omap_bootloader_tag; | ||
62 | while (info != NULL) { | ||
63 | u8 *next; | ||
64 | |||
65 | if (info->tag == tag) { | ||
66 | if (skip == 0) | ||
67 | break; | ||
68 | skip--; | ||
69 | } | ||
70 | |||
71 | if ((info->len & 0x03) != 0) { | ||
72 | /* We bail out to avoid an alignment fault */ | ||
73 | printk(KERN_ERR "OMAP peripheral config: Length (%d) not word-aligned (tag %04x)\n", | ||
74 | info->len, info->tag); | ||
75 | return NULL; | ||
76 | } | ||
77 | next = (u8 *) info + sizeof(*info) + info->len; | ||
78 | if (next >= omap_bootloader_tag + omap_bootloader_tag_len) | ||
79 | info = NULL; | ||
80 | else | ||
81 | info = (struct omap_board_config_entry *) next; | ||
82 | } | ||
83 | if (info != NULL) { | ||
84 | /* Check the length as a lame attempt to check for | ||
85 | * binary inconsistency. */ | ||
86 | if (len != NO_LENGTH_CHECK) { | ||
87 | /* Word-align len */ | ||
88 | if (len & 0x03) | ||
89 | len = (len + 3) & ~0x03; | ||
90 | if (info->len != len) { | ||
91 | printk(KERN_ERR "OMAP peripheral config: Length mismatch with tag %x (want %d, got %d)\n", | ||
92 | tag, len, info->len); | ||
93 | return NULL; | ||
94 | } | ||
95 | } | ||
96 | if (len_out != NULL) | ||
97 | *len_out = info->len; | ||
98 | return info->data; | ||
99 | } | ||
100 | #endif | ||
101 | /* Try to find the config from the board-specific structures | 57 | /* Try to find the config from the board-specific structures |
102 | * in the kernel. */ | 58 | * in the kernel. */ |
103 | for (i = 0; i < omap_board_config_size; i++) { | 59 | for (i = 0; i < omap_board_config_size; i++) { |
@@ -127,50 +83,6 @@ const void *omap_get_var_config(u16 tag, size_t *len) | |||
127 | } | 83 | } |
128 | EXPORT_SYMBOL(omap_get_var_config); | 84 | EXPORT_SYMBOL(omap_get_var_config); |
129 | 85 | ||
130 | static int __init omap_add_serial_console(void) | ||
131 | { | ||
132 | const struct omap_serial_console_config *con_info; | ||
133 | const struct omap_uart_config *uart_info; | ||
134 | static char speed[11], *opt = NULL; | ||
135 | int line, i, uart_idx; | ||
136 | |||
137 | uart_info = omap_get_config(OMAP_TAG_UART, struct omap_uart_config); | ||
138 | con_info = omap_get_config(OMAP_TAG_SERIAL_CONSOLE, | ||
139 | struct omap_serial_console_config); | ||
140 | if (uart_info == NULL || con_info == NULL) | ||
141 | return 0; | ||
142 | |||
143 | if (con_info->console_uart == 0) | ||
144 | return 0; | ||
145 | |||
146 | if (con_info->console_speed) { | ||
147 | snprintf(speed, sizeof(speed), "%u", con_info->console_speed); | ||
148 | opt = speed; | ||
149 | } | ||
150 | |||
151 | uart_idx = con_info->console_uart - 1; | ||
152 | if (uart_idx >= OMAP_MAX_NR_PORTS) { | ||
153 | printk(KERN_INFO "Console: external UART#%d. " | ||
154 | "Not adding it as console this time.\n", | ||
155 | uart_idx + 1); | ||
156 | return 0; | ||
157 | } | ||
158 | if (!(uart_info->enabled_uarts & (1 << uart_idx))) { | ||
159 | printk(KERN_ERR "Console: Selected UART#%d is " | ||
160 | "not enabled for this platform\n", | ||
161 | uart_idx + 1); | ||
162 | return -1; | ||
163 | } | ||
164 | line = 0; | ||
165 | for (i = 0; i < uart_idx; i++) { | ||
166 | if (uart_info->enabled_uarts & (1 << i)) | ||
167 | line++; | ||
168 | } | ||
169 | return add_preferred_console("ttyS", line, opt); | ||
170 | } | ||
171 | console_initcall(omap_add_serial_console); | ||
172 | |||
173 | |||
174 | /* | 86 | /* |
175 | * 32KHz clocksource ... always available, on pretty most chips except | 87 | * 32KHz clocksource ... always available, on pretty most chips except |
176 | * OMAP 730 and 1510. Other timers could be used as clocksources, with | 88 | * OMAP 730 and 1510. Other timers could be used as clocksources, with |
@@ -253,11 +165,8 @@ static struct clocksource clocksource_32k = { | |||
253 | */ | 165 | */ |
254 | unsigned long long sched_clock(void) | 166 | unsigned long long sched_clock(void) |
255 | { | 167 | { |
256 | unsigned long long ret; | 168 | return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k), |
257 | 169 | clocksource_32k.mult, clocksource_32k.shift); | |
258 | ret = (unsigned long long)clocksource_32k.read(&clocksource_32k); | ||
259 | ret = (ret * clocksource_32k.mult_orig) >> clocksource_32k.shift; | ||
260 | return ret; | ||
261 | } | 170 | } |
262 | 171 | ||
263 | static int __init omap_init_clocksource_32k(void) | 172 | static int __init omap_init_clocksource_32k(void) |