mach-ncp.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. /*
  2. * linux/arch/arm/mach-s3c64xx/mach-ncp.c
  3. *
  4. * Copyright (C) 2008-2009 Samsung Electronics
  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. */
  11. #include <linux/kernel.h>
  12. #include <linux/types.h>
  13. #include <linux/interrupt.h>
  14. #include <linux/list.h>
  15. #include <linux/timer.h>
  16. #include <linux/init.h>
  17. #include <linux/serial_core.h>
  18. #include <linux/serial_s3c.h>
  19. #include <linux/platform_device.h>
  20. #include <linux/io.h>
  21. #include <linux/i2c.h>
  22. #include <linux/fb.h>
  23. #include <linux/gpio.h>
  24. #include <linux/delay.h>
  25. #include <video/platform_lcd.h>
  26. #include <video/samsung_fimd.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <asm/mach/irq.h>
  30. #include <mach/irqs.h>
  31. #include <mach/hardware.h>
  32. #include <mach/map.h>
  33. #include <asm/irq.h>
  34. #include <asm/mach-types.h>
  35. #include <linux/platform_data/i2c-s3c2410.h>
  36. #include <plat/fb.h>
  37. #include <plat/devs.h>
  38. #include <plat/cpu.h>
  39. #include <plat/samsung-time.h>
  40. #include "common.h"
  41. #define UCON S3C2410_UCON_DEFAULT
  42. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
  43. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  44. static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = {
  45. /* REVISIT: NCP uses only serial 1, 2 */
  46. [0] = {
  47. .hwport = 0,
  48. .flags = 0,
  49. .ucon = UCON,
  50. .ulcon = ULCON,
  51. .ufcon = UFCON,
  52. },
  53. [1] = {
  54. .hwport = 1,
  55. .flags = 0,
  56. .ucon = UCON,
  57. .ulcon = ULCON,
  58. .ufcon = UFCON,
  59. },
  60. [2] = {
  61. .hwport = 2,
  62. .flags = 0,
  63. .ucon = UCON,
  64. .ulcon = ULCON,
  65. .ufcon = UFCON,
  66. },
  67. };
  68. static struct platform_device *ncp_devices[] __initdata = {
  69. &s3c_device_hsmmc1,
  70. &s3c_device_i2c0,
  71. };
  72. static struct map_desc ncp_iodesc[] __initdata = {};
  73. static void __init ncp_map_io(void)
  74. {
  75. s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
  76. s3c64xx_set_xtal_freq(12000000);
  77. s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
  78. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  79. }
  80. static void __init ncp_machine_init(void)
  81. {
  82. s3c_i2c0_set_platdata(NULL);
  83. platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices));
  84. }
  85. MACHINE_START(NCP, "NCP")
  86. /* Maintainer: Samsung Electronics */
  87. .atag_offset = 0x100,
  88. .nr_irqs = S3C64XX_NR_IRQS,
  89. .init_irq = s3c6410_init_irq,
  90. .map_io = ncp_map_io,
  91. .init_machine = ncp_machine_init,
  92. .init_time = samsung_timer_init,
  93. .restart = s3c64xx_restart,
  94. MACHINE_END