mach-smdkv310.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* linux/arch/arm/mach-s5pv310/mach-smdkv310.c
  2. *
  3. * Copyright (c) 2010 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/serial_core.h>
  11. #include <asm/mach/arch.h>
  12. #include <asm/mach-types.h>
  13. #include <asm/hardware/cache-l2x0.h>
  14. #include <plat/regs-serial.h>
  15. #include <plat/s5pv310.h>
  16. #include <plat/cpu.h>
  17. #include <mach/map.h>
  18. /* Following are default values for UCON, ULCON and UFCON UART registers */
  19. #define SMDKV310_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  20. S3C2410_UCON_RXILEVEL | \
  21. S3C2410_UCON_TXIRQMODE | \
  22. S3C2410_UCON_RXIRQMODE | \
  23. S3C2410_UCON_RXFIFO_TOI | \
  24. S3C2443_UCON_RXERR_IRQEN)
  25. #define SMDKV310_ULCON_DEFAULT S3C2410_LCON_CS8
  26. #define SMDKV310_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  27. S5PV210_UFCON_TXTRIG4 | \
  28. S5PV210_UFCON_RXTRIG4)
  29. static struct s3c2410_uartcfg smdkv310_uartcfgs[] __initdata = {
  30. [0] = {
  31. .hwport = 0,
  32. .flags = 0,
  33. .ucon = SMDKV310_UCON_DEFAULT,
  34. .ulcon = SMDKV310_ULCON_DEFAULT,
  35. .ufcon = SMDKV310_UFCON_DEFAULT,
  36. },
  37. [1] = {
  38. .hwport = 1,
  39. .flags = 0,
  40. .ucon = SMDKV310_UCON_DEFAULT,
  41. .ulcon = SMDKV310_ULCON_DEFAULT,
  42. .ufcon = SMDKV310_UFCON_DEFAULT,
  43. },
  44. [2] = {
  45. .hwport = 2,
  46. .flags = 0,
  47. .ucon = SMDKV310_UCON_DEFAULT,
  48. .ulcon = SMDKV310_ULCON_DEFAULT,
  49. .ufcon = SMDKV310_UFCON_DEFAULT,
  50. },
  51. [3] = {
  52. .hwport = 3,
  53. .flags = 0,
  54. .ucon = SMDKV310_UCON_DEFAULT,
  55. .ulcon = SMDKV310_ULCON_DEFAULT,
  56. .ufcon = SMDKV310_UFCON_DEFAULT,
  57. },
  58. };
  59. static void __init smdkv310_map_io(void)
  60. {
  61. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  62. s3c24xx_init_clocks(24000000);
  63. s3c24xx_init_uarts(smdkv310_uartcfgs, ARRAY_SIZE(smdkv310_uartcfgs));
  64. }
  65. static void __init smdkv310_machine_init(void)
  66. {
  67. #ifdef CONFIG_CACHE_L2X0
  68. l2x0_init(S5P_VA_L2CC, 1 << 28, 0xffffffff);
  69. #endif
  70. }
  71. MACHINE_START(SMDKV310, "SMDKV310")
  72. /* Maintainer: Kukjin Kim <kgene.kim@samsung.com> */
  73. /* Maintainer: Changhwan Youn <chaos.youn@samsung.com> */
  74. .phys_io = S3C_PA_UART & 0xfff00000,
  75. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  76. .boot_params = S5P_PA_SDRAM + 0x100,
  77. .init_irq = s5pv310_init_irq,
  78. .map_io = smdkv310_map_io,
  79. .init_machine = smdkv310_machine_init,
  80. .timer = &s5pv310_timer,
  81. MACHINE_END