board-tcc8000-sdk.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (C) 2009 Hans J. Koch <hjk@linutronix.de>
  3. *
  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. */
  8. #include <linux/delay.h>
  9. #include <linux/init.h>
  10. #include <linux/kernel.h>
  11. #include <linux/platform_device.h>
  12. #include <asm/mach-types.h>
  13. #include <asm/mach/arch.h>
  14. #include <asm/mach/map.h>
  15. #include <asm/mach/time.h>
  16. #include <mach/clock.h>
  17. #include <mach/tcc-nand.h>
  18. #include <mach/tcc8k-regs.h>
  19. #include "common.h"
  20. #define XI_FREQUENCY 12000000
  21. #define XTI_FREQUENCY 32768
  22. #ifdef CONFIG_MTD_NAND_TCC
  23. /* NAND */
  24. static struct tcc_nand_platform_data tcc8k_sdk_nand_data = {
  25. .width = 1,
  26. .hw_ecc = 0,
  27. };
  28. #endif
  29. static void __init tcc8k_init(void)
  30. {
  31. #ifdef CONFIG_MTD_NAND_TCC
  32. tcc_nand_device.dev.platform_data = &tcc8k_sdk_nand_data;
  33. platform_device_register(&tcc_nand_device);
  34. #endif
  35. }
  36. static void __init tcc8k_init_timer(void)
  37. {
  38. tcc_clocks_init(XI_FREQUENCY, XTI_FREQUENCY);
  39. }
  40. static struct sys_timer tcc8k_timer = {
  41. .init = tcc8k_init_timer,
  42. };
  43. static void __init tcc8k_map_io(void)
  44. {
  45. tcc8k_map_common_io();
  46. /* set PLL0 clock to 96MHz, adapt UART0 divisor */
  47. __raw_writel(0x00026003, CKC_BASE + PLL0CFG_OFFS);
  48. __raw_writel(0x10000001, CKC_BASE + ACLKUART0_OFFS);
  49. /* set PLL1 clock to 192MHz */
  50. __raw_writel(0x00016003, CKC_BASE + PLL1CFG_OFFS);
  51. /* set PLL2 clock to 48MHz */
  52. __raw_writel(0x00036003, CKC_BASE + PLL2CFG_OFFS);
  53. /* with CPU freq higher than 150 MHz, need extra DTCM wait */
  54. __raw_writel(0x00000001, SCFG_BASE + DTCMWAIT_OFFS);
  55. /* PLL locking time as specified */
  56. udelay(300);
  57. }
  58. MACHINE_START(TCC8000_SDK, "Telechips TCC8000-SDK Demo Board")
  59. .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
  60. .map_io = tcc8k_map_io,
  61. .init_irq = tcc8k_init_irq,
  62. .init_machine = tcc8k_init,
  63. .timer = &tcc8k_timer,
  64. MACHINE_END