mach-ncp.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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/platform_device.h>
  19. #include <linux/io.h>
  20. #include <linux/i2c.h>
  21. #include <linux/fb.h>
  22. #include <linux/gpio.h>
  23. #include <linux/delay.h>
  24. #include <video/platform_lcd.h>
  25. #include <asm/hardware/vic.h>
  26. #include <asm/mach/arch.h>
  27. #include <asm/mach/map.h>
  28. #include <asm/mach/irq.h>
  29. #include <mach/hardware.h>
  30. #include <mach/map.h>
  31. #include <asm/irq.h>
  32. #include <asm/mach-types.h>
  33. #include <plat/regs-serial.h>
  34. #include <plat/iic.h>
  35. #include <plat/fb.h>
  36. #include <plat/clock.h>
  37. #include <plat/devs.h>
  38. #include <plat/cpu.h>
  39. #include <plat/regs-fb-v4.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. s3c24xx_init_clocks(12000000);
  77. s3c24xx_init_uarts(ncp_uartcfgs, ARRAY_SIZE(ncp_uartcfgs));
  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. .handle_irq = vic_handle_irq,
  89. .map_io = ncp_map_io,
  90. .init_machine = ncp_machine_init,
  91. .timer = &s3c24xx_timer,
  92. .restart = s3c64xx_restart,
  93. MACHINE_END