184
184
.type = CLK_TYPE_PERIPHERAL,
187
/* One additional fake clock for ohci */
188
static struct clk ohci_clk = {
191
.type = CLK_TYPE_PERIPHERAL,
192
.parent = &uhphs_clk,
195
/* One additional fake clock for second TC block */
196
static struct clk tcb1_clk = {
199
.type = CLK_TYPE_PERIPHERAL,
203
187
static struct clk *periph_clocks[] __initdata = {
217
static struct clk_lookup periph_clocks_lookups[] = {
218
/* One additional fake clock for ohci */
219
CLKDEV_CON_ID("ohci_clk", &uhphs_clk),
220
CLKDEV_CON_DEV_ID("ehci_clk", "atmel-ehci", &uhphs_clk),
221
CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
222
CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
223
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.0", &mmc0_clk),
224
CLKDEV_CON_DEV_ID("mci_clk", "atmel_mci.1", &mmc1_clk),
225
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
226
CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
227
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb0_clk),
228
CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.1", &tcb0_clk),
229
CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
230
CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
233
static struct clk_lookup usart_clocks_lookups[] = {
234
CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
235
CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
236
CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
237
CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
238
CLKDEV_CON_DEV_ID("usart", "atmel_usart.4", &usart3_clk),
256
262
for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
257
263
clk_register(periph_clocks[i]);
265
clkdev_add_table(periph_clocks_lookups,
266
ARRAY_SIZE(periph_clocks_lookups));
267
clkdev_add_table(usart_clocks_lookups,
268
ARRAY_SIZE(usart_clocks_lookups));
259
270
if (cpu_is_at91sam9m10() || cpu_is_at91sam9m11())
260
271
clk_register(&vdec_clk);
263
274
clk_register(&pck1);
277
static struct clk_lookup console_clock_lookup;
279
void __init at91sam9g45_set_console_clock(int id)
281
if (id >= ARRAY_SIZE(usart_clocks_lookups))
284
console_clock_lookup.con_id = "usart";
285
console_clock_lookup.clk = usart_clocks_lookups[id].clk;
286
clkdev_add(&console_clock_lookup);
266
289
/* --------------------------------------------------------------------
268
291
* -------------------------------------------------------------------- */
306
329
* AT91SAM9G45 processor initialization
307
330
* -------------------------------------------------------------------- */
309
void __init at91sam9g45_initialize(unsigned long main_clock)
332
void __init at91sam9g45_map_io(void)
311
334
/* Map peripherals */
312
335
iotable_init(at91sam9g45_io_desc, ARRAY_SIZE(at91sam9g45_io_desc));
338
void __init at91sam9g45_initialize(unsigned long main_clock)
314
340
at91_arch_reset = at91sam9g45_reset;
315
341
pm_power_off = at91sam9g45_poweroff;
316
342
at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);