Merge remote-tracking branch 's5p/for-next'
[linux-2.6/next.git] / arch / arm / mach-tcc8k / board-tcc8000-sdk.c
blob4cb3c2dd905cb8e994a4df5febbfc067d4a9036a
1 /*
2 * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
9 #include <linux/delay.h>
10 #include <linux/init.h>
11 #include <linux/kernel.h>
12 #include <linux/platform_device.h>
14 #include <asm/mach-types.h>
16 #include <asm/mach/arch.h>
17 #include <asm/mach/map.h>
18 #include <asm/mach/time.h>
20 #include <mach/clock.h>
21 #include <mach/tcc-nand.h>
22 #include <mach/tcc8k-regs.h>
24 #include "common.h"
26 #define XI_FREQUENCY 12000000
27 #define XTI_FREQUENCY 32768
29 #ifdef CONFIG_MTD_NAND_TCC
30 /* NAND */
31 static struct tcc_nand_platform_data tcc8k_sdk_nand_data = {
32 .width = 1,
33 .hw_ecc = 0,
35 #endif
37 static void __init tcc8k_init(void)
39 #ifdef CONFIG_MTD_NAND_TCC
40 tcc_nand_device.dev.platform_data = &tcc8k_sdk_nand_data;
41 platform_device_register(&tcc_nand_device);
42 #endif
45 static void __init tcc8k_init_timer(void)
47 tcc_clocks_init(XI_FREQUENCY, XTI_FREQUENCY);
50 static struct sys_timer tcc8k_timer = {
51 .init = tcc8k_init_timer,
54 static void __init tcc8k_map_io(void)
56 tcc8k_map_common_io();
58 /* set PLL0 clock to 96MHz, adapt UART0 divisor */
59 __raw_writel(0x00026003, CKC_BASE + PLL0CFG_OFFS);
60 __raw_writel(0x10000001, CKC_BASE + ACLKUART0_OFFS);
62 /* set PLL1 clock to 192MHz */
63 __raw_writel(0x00016003, CKC_BASE + PLL1CFG_OFFS);
65 /* set PLL2 clock to 48MHz */
66 __raw_writel(0x00036003, CKC_BASE + PLL2CFG_OFFS);
68 /* with CPU freq higher than 150 MHz, need extra DTCM wait */
69 __raw_writel(0x00000001, SCFG_BASE + DTCMWAIT_OFFS);
71 /* PLL locking time as specified */
72 udelay(300);
75 MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board")
76 .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
77 .map_io = tcc8k_map_io,
78 .init_irq = tcc8k_init_irq,
79 .init_machine = tcc8k_init,
80 .timer = &tcc8k_timer,
81 MACHINE_END