mach-aquila.c 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* linux/arch/arm/mach-s5pv210/mach-aquila.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/kernel.h>
  11. #include <linux/types.h>
  12. #include <linux/init.h>
  13. #include <linux/serial_core.h>
  14. #include <linux/fb.h>
  15. #include <asm/mach/arch.h>
  16. #include <asm/mach/map.h>
  17. #include <asm/setup.h>
  18. #include <asm/mach-types.h>
  19. #include <mach/map.h>
  20. #include <mach/regs-clock.h>
  21. #include <mach/regs-fb.h>
  22. #include <plat/regs-serial.h>
  23. #include <plat/s5pv210.h>
  24. #include <plat/devs.h>
  25. #include <plat/cpu.h>
  26. #include <plat/fb.h>
  27. /* Following are default values for UCON, ULCON and UFCON UART registers */
  28. #define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
  29. S3C2410_UCON_RXILEVEL | \
  30. S3C2410_UCON_TXIRQMODE | \
  31. S3C2410_UCON_RXIRQMODE | \
  32. S3C2410_UCON_RXFIFO_TOI | \
  33. S3C2443_UCON_RXERR_IRQEN)
  34. #define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
  35. #define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
  36. S5PV210_UFCON_TXTRIG4 | \
  37. S5PV210_UFCON_RXTRIG4)
  38. static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
  39. [0] = {
  40. .hwport = 0,
  41. .flags = 0,
  42. .ucon = S5PV210_UCON_DEFAULT,
  43. .ulcon = S5PV210_ULCON_DEFAULT,
  44. .ufcon = S5PV210_UFCON_DEFAULT,
  45. },
  46. [1] = {
  47. .hwport = 1,
  48. .flags = 0,
  49. .ucon = S5PV210_UCON_DEFAULT,
  50. .ulcon = S5PV210_ULCON_DEFAULT,
  51. .ufcon = S5PV210_UFCON_DEFAULT,
  52. },
  53. [2] = {
  54. .hwport = 2,
  55. .flags = 0,
  56. .ucon = S5PV210_UCON_DEFAULT,
  57. .ulcon = S5PV210_ULCON_DEFAULT,
  58. .ufcon = S5PV210_UFCON_DEFAULT,
  59. },
  60. [3] = {
  61. .hwport = 3,
  62. .flags = 0,
  63. .ucon = S5PV210_UCON_DEFAULT,
  64. .ulcon = S5PV210_ULCON_DEFAULT,
  65. .ufcon = S5PV210_UFCON_DEFAULT,
  66. },
  67. };
  68. /* Frame Buffer */
  69. static struct s3c_fb_pd_win aquila_fb_win0 = {
  70. .win_mode = {
  71. .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60),
  72. .left_margin = 16,
  73. .right_margin = 16,
  74. .upper_margin = 3,
  75. .lower_margin = 28,
  76. .hsync_len = 2,
  77. .vsync_len = 2,
  78. .xres = 480,
  79. .yres = 800,
  80. },
  81. .max_bpp = 32,
  82. .default_bpp = 16,
  83. };
  84. static struct s3c_fb_pd_win aquila_fb_win1 = {
  85. .win_mode = {
  86. .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60),
  87. .left_margin = 16,
  88. .right_margin = 16,
  89. .upper_margin = 3,
  90. .lower_margin = 28,
  91. .hsync_len = 2,
  92. .vsync_len = 2,
  93. .xres = 480,
  94. .yres = 800,
  95. },
  96. .max_bpp = 32,
  97. .default_bpp = 16,
  98. };
  99. static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
  100. .win[0] = &aquila_fb_win0,
  101. .win[1] = &aquila_fb_win1,
  102. .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
  103. .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
  104. VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
  105. .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
  106. };
  107. static struct platform_device *aquila_devices[] __initdata = {
  108. &s3c_device_fb,
  109. };
  110. static void __init aquila_map_io(void)
  111. {
  112. s5p_init_io(NULL, 0, S5P_VA_CHIPID);
  113. s3c24xx_init_clocks(24000000);
  114. s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
  115. }
  116. static void __init aquila_machine_init(void)
  117. {
  118. /* FB */
  119. s3c_fb_set_platdata(&aquila_lcd_pdata);
  120. platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
  121. }
  122. MACHINE_START(AQUILA, "Aquila")
  123. /* Maintainers:
  124. Marek Szyprowski <m.szyprowski@samsung.com>
  125. Kyungmin Park <kyungmin.park@samsung.com> */
  126. .phys_io = S3C_PA_UART & 0xfff00000,
  127. .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
  128. .boot_params = S5P_PA_SDRAM + 0x100,
  129. .init_irq = s5pv210_init_irq,
  130. .map_io = aquila_map_io,
  131. .init_machine = aquila_machine_init,
  132. .timer = &s3c24xx_timer,
  133. MACHINE_END