mach-ncp.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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/hardware.h>
  31. #include <mach/map.h>
  32. #include <asm/irq.h>
  33. #include <asm/mach-types.h>
  34. #include <linux/platform_data/i2c-s3c2410.h>
  35. #include <plat/fb.h>
  36. #include <plat/devs.h>
  37. #include <plat/cpu.h>
  38. #include <plat/samsung-time.h>
  39. #include "common.h"
  40. #define UCON S3C2410_UCON_DEFAULT
  41. #define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE
  42. #define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
  43. static struct s3c2410_uartcfg ncp_uartcfgs[] __initdata = {
  44. /* REVISIT: NCP uses only serial 1, 2 */
  45. [0] = {
  46. .hwport = 0,
  47. .flags = 0,
  48. .ucon = UCON,
  49. .ulcon = ULCON,
  50. .ufcon = UFCON,
  51. },
  52. [1] = {
  53. .hwport = 1,
  54. .flags = 0,
  55. .ucon = UCON,
  56. .ulcon = ULCON,
  57. .ufcon = UFCON,
  58. },
  59. [2] = {
  60. .hwport = 2,
  61. .flags = 0,
  62. .ucon = UCON,
  63. .ulcon = ULCON,
  64. .ufcon = UFCON,
  65. },
  66. };
  67. static struct platform_device *ncp_devices[] __initdata = {
  68. &s3c_device_hsmmc1,
  69. &s3c_device_i2c0,
  70. };
  71. static struct map_desc ncp_iodesc[] __initdata = {};
  72. static void __init ncp_map_io(void)
  73. {
  74. s3c64xx_init_io(ncp_iodesc, ARRAY_SIZE(ncp_iodesc));
  75. s3c64xx_set_xtal_freq(12000000);
  76. s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
  77. samsung_set_timer_source(SAMSUNG_PWM3, SAMSUNG_PWM4);
  78. }
  79. static void __init ncp_machine_init(void)
  80. {
  81. s3c_i2c0_set_platdata(NULL);
  82. platform_add_devices(ncp_devices, ARRAY_SIZE(ncp_devices));
  83. }
  84. MACHINE_START(NCP, "NCP")
  85. /* Maintainer: Samsung Electronics */
  86. .atag_offset = 0x100,
  87. .init_irq = s3c6410_init_irq,
  88. .map_io = ncp_map_io,
  89. .init_machine = ncp_machine_init,
  90. .init_time = samsung_timer_init,
  91. .restart = s3c64xx_restart,
  92. MACHINE_END