mach-n30.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. /* Machine specific code for the Acer n30 PDA.
  2. *
  3. * Copyright (c) 2003-2005 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * Copyright (c) 2005-2008 Christer Weinigel <christer@weinigel.se>
  7. *
  8. * There is a wiki with more information about the n30 port at
  9. * http://handhelds.org/moin/moin.cgi/AcerN30Documentation .
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/types.h>
  17. #include <linux/delay.h>
  18. #include <linux/init.h>
  19. #include <linux/interrupt.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/serial_core.h>
  22. #include <linux/timer.h>
  23. #include <asm/hardware.h>
  24. #include <asm/io.h>
  25. #include <asm/irq.h>
  26. #include <asm/mach-types.h>
  27. #include <asm/arch/regs-gpio.h>
  28. #include <asm/mach/arch.h>
  29. #include <asm/mach/irq.h>
  30. #include <asm/mach/map.h>
  31. #include <asm/plat-s3c/iic.h>
  32. #include <asm/plat-s3c/regs-serial.h>
  33. #include <asm/plat-s3c24xx/clock.h>
  34. #include <asm/plat-s3c24xx/cpu.h>
  35. #include <asm/plat-s3c24xx/devs.h>
  36. #include <asm/plat-s3c24xx/s3c2410.h>
  37. static struct map_desc n30_iodesc[] __initdata = {
  38. /* nothing here yet */
  39. };
  40. static struct s3c2410_uartcfg n30_uartcfgs[] = {
  41. /* Normal serial port */
  42. [0] = {
  43. .hwport = 0,
  44. .flags = 0,
  45. .ucon = 0x2c5,
  46. .ulcon = 0x03,
  47. .ufcon = 0x51,
  48. },
  49. /* IR port */
  50. [1] = {
  51. .hwport = 1,
  52. .flags = 0,
  53. .uart_flags = UPF_CONS_FLOW,
  54. .ucon = 0x2c5,
  55. .ulcon = 0x43,
  56. .ufcon = 0x51,
  57. },
  58. /* The BlueTooth controller is connected to port 2 */
  59. [2] = {
  60. .hwport = 2,
  61. .flags = 0,
  62. .ucon = 0x2c5,
  63. .ulcon = 0x03,
  64. .ufcon = 0x51,
  65. },
  66. };
  67. static struct platform_device *n30_devices[] __initdata = {
  68. &s3c_device_lcd,
  69. &s3c_device_wdt,
  70. &s3c_device_i2c,
  71. &s3c_device_iis,
  72. &s3c_device_usb,
  73. &s3c_device_usbgadget,
  74. };
  75. static struct s3c2410_platform_i2c n30_i2ccfg = {
  76. .flags = 0,
  77. .slave_addr = 0x10,
  78. .bus_freq = 10*1000,
  79. .max_freq = 10*1000,
  80. };
  81. static void __init n30_map_io(void)
  82. {
  83. s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
  84. s3c24xx_init_clocks(0);
  85. s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
  86. }
  87. static void __init n30_init_irq(void)
  88. {
  89. s3c24xx_init_irq();
  90. }
  91. /* GPB3 is the line that controls the pull-up for the USB D+ line */
  92. static void __init n30_init(void)
  93. {
  94. s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
  95. /* Turn off suspend on both USB ports, and switch the
  96. * selectable USB port to USB device mode. */
  97. s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
  98. S3C2410_MISCCR_USBSUSPND0 |
  99. S3C2410_MISCCR_USBSUSPND1, 0x0);
  100. platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices));
  101. }
  102. MACHINE_START(N30, "Acer-N30")
  103. /* Maintainer: Christer Weinigel <christer@weinigel.se>,
  104. Ben Dooks <ben-linux@fluff.org>
  105. */
  106. .phys_io = S3C2410_PA_UART,
  107. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  108. .boot_params = S3C2410_SDRAM_PA + 0x100,
  109. .timer = &s3c24xx_timer,
  110. .init_machine = n30_init,
  111. .init_irq = n30_init_irq,
  112. .map_io = n30_map_io,
  113. MACHINE_END