~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/arm/mach-at91/at91sam9g45.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
        .type           = CLK_TYPE_PERIPHERAL,
185
185
};
186
186
 
187
 
/* One additional fake clock for ohci */
188
 
static struct clk ohci_clk = {
189
 
        .name           = "ohci_clk",
190
 
        .pmc_mask       = 0,
191
 
        .type           = CLK_TYPE_PERIPHERAL,
192
 
        .parent         = &uhphs_clk,
193
 
};
194
 
 
195
 
/* One additional fake clock for second TC block */
196
 
static struct clk tcb1_clk = {
197
 
        .name           = "tcb1_clk",
198
 
        .pmc_mask       = 0,
199
 
        .type           = CLK_TYPE_PERIPHERAL,
200
 
        .parent         = &tcb0_clk,
201
 
};
202
 
 
203
187
static struct clk *periph_clocks[] __initdata = {
204
188
        &pioA_clk,
205
189
        &pioB_clk,
228
212
        &udphs_clk,
229
213
        &mmc1_clk,
230
214
        // irq0
231
 
        &ohci_clk,
232
 
        &tcb1_clk,
 
215
};
 
216
 
 
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),
 
231
};
 
232
 
 
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),
233
239
};
234
240
 
235
241
/*
256
262
        for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
257
263
                clk_register(periph_clocks[i]);
258
264
 
 
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));
 
269
 
259
270
        if (cpu_is_at91sam9m10() || cpu_is_at91sam9m11())
260
271
                clk_register(&vdec_clk);
261
272
 
263
274
        clk_register(&pck1);
264
275
}
265
276
 
 
277
static struct clk_lookup console_clock_lookup;
 
278
 
 
279
void __init at91sam9g45_set_console_clock(int id)
 
280
{
 
281
        if (id >= ARRAY_SIZE(usart_clocks_lookups))
 
282
                return;
 
283
 
 
284
        console_clock_lookup.con_id = "usart";
 
285
        console_clock_lookup.clk = usart_clocks_lookups[id].clk;
 
286
        clkdev_add(&console_clock_lookup);
 
287
}
 
288
 
266
289
/* --------------------------------------------------------------------
267
290
 *  GPIO
268
291
 * -------------------------------------------------------------------- */
306
329
 *  AT91SAM9G45 processor initialization
307
330
 * -------------------------------------------------------------------- */
308
331
 
309
 
void __init at91sam9g45_initialize(unsigned long main_clock)
 
332
void __init at91sam9g45_map_io(void)
310
333
{
311
334
        /* Map peripherals */
312
335
        iotable_init(at91sam9g45_io_desc, ARRAY_SIZE(at91sam9g45_io_desc));
 
336
}
313
337
 
 
338
void __init at91sam9g45_initialize(unsigned long main_clock)
 
339
{
314
340
        at91_arch_reset = at91sam9g45_reset;
315
341
        pm_power_off = at91sam9g45_poweroff;
316
342
        at91_extern_irq = (1 << AT91SAM9G45_ID_IRQ0);