mach-n30.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* linux/arch/arm/mach-s3c2410/mach-n30.c
  2. *
  3. * Copyright (c) 2003-2005 Simtec Electronics
  4. * Ben Dooks <ben@simtec.co.uk>
  5. *
  6. * Copyright (c) 2005 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/interrupt.h>
  18. #include <linux/list.h>
  19. #include <linux/timer.h>
  20. #include <linux/init.h>
  21. #include <linux/delay.h>
  22. #include <linux/serial_core.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/kthread.h>
  25. #include <asm/mach/arch.h>
  26. #include <asm/mach/map.h>
  27. #include <asm/mach/irq.h>
  28. #include <asm/hardware.h>
  29. #include <asm/io.h>
  30. #include <asm/irq.h>
  31. #include <asm/mach-types.h>
  32. #include <asm/plat-s3c/regs-serial.h>
  33. #include <asm/arch/regs-gpio.h>
  34. #include <asm/plat-s3c/iic.h>
  35. #include <asm/plat-s3c24xx/s3c2410.h>
  36. #include <asm/plat-s3c24xx/clock.h>
  37. #include <asm/plat-s3c24xx/devs.h>
  38. #include <asm/plat-s3c24xx/cpu.h>
  39. static struct map_desc n30_iodesc[] __initdata = {
  40. /* nothing here yet */
  41. };
  42. static struct s3c2410_uartcfg n30_uartcfgs[] = {
  43. /* Normal serial port */
  44. [0] = {
  45. .hwport = 0,
  46. .flags = 0,
  47. .ucon = 0x2c5,
  48. .ulcon = 0x03,
  49. .ufcon = 0x51,
  50. },
  51. /* IR port */
  52. [1] = {
  53. .hwport = 1,
  54. .flags = 0,
  55. .uart_flags = UPF_CONS_FLOW,
  56. .ucon = 0x2c5,
  57. .ulcon = 0x43,
  58. .ufcon = 0x51,
  59. },
  60. /* The BlueTooth controller is connected to port 2 */
  61. [2] = {
  62. .hwport = 2,
  63. .flags = 0,
  64. .ucon = 0x2c5,
  65. .ulcon = 0x03,
  66. .ufcon = 0x51,
  67. },
  68. };
  69. static struct platform_device *n30_devices[] __initdata = {
  70. &s3c_device_usb,
  71. &s3c_device_lcd,
  72. &s3c_device_wdt,
  73. &s3c_device_i2c,
  74. &s3c_device_iis,
  75. &s3c_device_usbgadget,
  76. };
  77. static struct s3c2410_platform_i2c n30_i2ccfg = {
  78. .flags = 0,
  79. .slave_addr = 0x10,
  80. .bus_freq = 10*1000,
  81. .max_freq = 10*1000,
  82. };
  83. static void __init n30_map_io(void)
  84. {
  85. s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
  86. s3c24xx_init_clocks(0);
  87. s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
  88. }
  89. static void __init n30_init_irq(void)
  90. {
  91. s3c24xx_init_irq();
  92. }
  93. /* GPB3 is the line that controls the pull-up for the USB D+ line */
  94. static void __init n30_init(void)
  95. {
  96. s3c_device_i2c.dev.platform_data = &n30_i2ccfg;
  97. /* Turn off suspend on both USB ports, and switch the
  98. * selectable USB port to USB device mode. */
  99. s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
  100. S3C2410_MISCCR_USBSUSPND0 |
  101. S3C2410_MISCCR_USBSUSPND1, 0x0);
  102. platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices));
  103. }
  104. MACHINE_START(N30, "Acer-N30")
  105. /* Maintainer: Christer Weinigel <christer@weinigel.se>,
  106. Ben Dooks <ben-linux@fluff.org>
  107. */
  108. .phys_io = S3C2410_PA_UART,
  109. .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
  110. .boot_params = S3C2410_SDRAM_PA + 0x100,
  111. .timer = &s3c24xx_timer,
  112. .init_machine = n30_init,
  113. .init_irq = n30_init_irq,
  114. .map_io = n30_map_io,
  115. MACHINE_END
  116. /*
  117. Local variables:
  118. compile-command: "make ARCH=arm CROSS_COMPILE=/usr/local/arm/3.3.2/bin/arm-linux- -k -C ../../.."
  119. c-basic-offset: 8
  120. End:
  121. */