board-h3.c 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. /*
  2. * linux/arch/arm/mach-omap1/board-h3.c
  3. *
  4. * This file contains OMAP1710 H3 specific code.
  5. *
  6. * Copyright (C) 2004 Texas Instruments, Inc.
  7. * Copyright (C) 2002 MontaVista Software, Inc.
  8. * Copyright (C) 2001 RidgeRun, Inc.
  9. * Author: RidgeRun, Inc.
  10. * Greg Lonnon (glonnon@ridgerun.com) or info@ridgerun.com
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License version 2 as
  14. * published by the Free Software Foundation.
  15. */
  16. #include <linux/config.h>
  17. #include <linux/types.h>
  18. #include <linux/init.h>
  19. #include <linux/major.h>
  20. #include <linux/kernel.h>
  21. #include <linux/platform_device.h>
  22. #include <linux/errno.h>
  23. #include <linux/mtd/mtd.h>
  24. #include <linux/mtd/partitions.h>
  25. #include <asm/setup.h>
  26. #include <asm/page.h>
  27. #include <asm/hardware.h>
  28. #include <asm/mach-types.h>
  29. #include <asm/mach/arch.h>
  30. #include <asm/mach/flash.h>
  31. #include <asm/mach/map.h>
  32. #include <asm/arch/gpio.h>
  33. #include <asm/arch/irqs.h>
  34. #include <asm/arch/mux.h>
  35. #include <asm/arch/tc.h>
  36. #include <asm/arch/usb.h>
  37. #include <asm/arch/common.h>
  38. extern int omap_gpio_init(void);
  39. static struct mtd_partition h3_partitions[] = {
  40. /* bootloader (U-Boot, etc) in first sector */
  41. {
  42. .name = "bootloader",
  43. .offset = 0,
  44. .size = SZ_128K,
  45. .mask_flags = MTD_WRITEABLE, /* force read-only */
  46. },
  47. /* bootloader params in the next sector */
  48. {
  49. .name = "params",
  50. .offset = MTDPART_OFS_APPEND,
  51. .size = SZ_128K,
  52. .mask_flags = 0,
  53. },
  54. /* kernel */
  55. {
  56. .name = "kernel",
  57. .offset = MTDPART_OFS_APPEND,
  58. .size = SZ_2M,
  59. .mask_flags = 0
  60. },
  61. /* file system */
  62. {
  63. .name = "filesystem",
  64. .offset = MTDPART_OFS_APPEND,
  65. .size = MTDPART_SIZ_FULL,
  66. .mask_flags = 0
  67. }
  68. };
  69. static struct flash_platform_data h3_flash_data = {
  70. .map_name = "cfi_probe",
  71. .width = 2,
  72. .parts = h3_partitions,
  73. .nr_parts = ARRAY_SIZE(h3_partitions),
  74. };
  75. static struct resource h3_flash_resource = {
  76. /* This is on CS3, wherever it's mapped */
  77. .flags = IORESOURCE_MEM,
  78. };
  79. static struct platform_device flash_device = {
  80. .name = "omapflash",
  81. .id = 0,
  82. .dev = {
  83. .platform_data = &h3_flash_data,
  84. },
  85. .num_resources = 1,
  86. .resource = &h3_flash_resource,
  87. };
  88. static struct resource smc91x_resources[] = {
  89. [0] = {
  90. .start = OMAP1710_ETHR_START, /* Physical */
  91. .end = OMAP1710_ETHR_START + 0xf,
  92. .flags = IORESOURCE_MEM,
  93. },
  94. [1] = {
  95. .start = OMAP_GPIO_IRQ(40),
  96. .end = OMAP_GPIO_IRQ(40),
  97. .flags = IORESOURCE_IRQ,
  98. },
  99. };
  100. static struct platform_device smc91x_device = {
  101. .name = "smc91x",
  102. .id = 0,
  103. .num_resources = ARRAY_SIZE(smc91x_resources),
  104. .resource = smc91x_resources,
  105. };
  106. #define GPTIMER_BASE 0xFFFB1400
  107. #define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
  108. #define GPTIMER_REGS_SIZE 0x46
  109. static struct resource intlat_resources[] = {
  110. [0] = {
  111. .start = GPTIMER_REGS(0), /* Physical */
  112. .end = GPTIMER_REGS(0) + GPTIMER_REGS_SIZE,
  113. .flags = IORESOURCE_MEM,
  114. },
  115. [1] = {
  116. .start = INT_1610_GPTIMER1,
  117. .end = INT_1610_GPTIMER1,
  118. .flags = IORESOURCE_IRQ,
  119. },
  120. };
  121. static struct platform_device intlat_device = {
  122. .name = "omap_intlat",
  123. .id = 0,
  124. .num_resources = ARRAY_SIZE(intlat_resources),
  125. .resource = intlat_resources,
  126. };
  127. static struct platform_device *devices[] __initdata = {
  128. &flash_device,
  129. &smc91x_device,
  130. &intlat_device,
  131. };
  132. static struct omap_usb_config h3_usb_config __initdata = {
  133. /* usb1 has a Mini-AB port and external isp1301 transceiver */
  134. .otg = 2,
  135. #ifdef CONFIG_USB_GADGET_OMAP
  136. .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
  137. #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  138. /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
  139. .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
  140. #endif
  141. .pins[1] = 3,
  142. };
  143. static struct omap_mmc_config h3_mmc_config __initdata = {
  144. .mmc[0] = {
  145. .enabled = 1,
  146. .power_pin = -1, /* tps65010 GPIO4 */
  147. .switch_pin = OMAP_MPUIO(1),
  148. },
  149. };
  150. static struct omap_uart_config h3_uart_config __initdata = {
  151. .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
  152. };
  153. static struct omap_lcd_config h3_lcd_config __initdata = {
  154. .panel_name = "h3",
  155. .ctrl_name = "internal",
  156. };
  157. static struct omap_board_config_kernel h3_config[] = {
  158. { OMAP_TAG_USB, &h3_usb_config },
  159. { OMAP_TAG_MMC, &h3_mmc_config },
  160. { OMAP_TAG_UART, &h3_uart_config },
  161. { OMAP_TAG_LCD, &h3_lcd_config },
  162. };
  163. static void __init h3_init(void)
  164. {
  165. h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys();
  166. h3_flash_resource.end += OMAP_CS3_SIZE - 1;
  167. (void) platform_add_devices(devices, ARRAY_SIZE(devices));
  168. omap_board_config = h3_config;
  169. omap_board_config_size = ARRAY_SIZE(h3_config);
  170. omap_serial_init();
  171. }
  172. static void __init h3_init_smc91x(void)
  173. {
  174. omap_cfg_reg(W15_1710_GPIO40);
  175. if (omap_request_gpio(40) < 0) {
  176. printk("Error requesting gpio 40 for smc91x irq\n");
  177. return;
  178. }
  179. }
  180. void h3_init_irq(void)
  181. {
  182. omap_init_irq();
  183. omap_gpio_init();
  184. h3_init_smc91x();
  185. }
  186. static void __init h3_map_io(void)
  187. {
  188. omap_map_common_io();
  189. }
  190. MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
  191. /* Maintainer: Texas Instruments, Inc. */
  192. .phys_io = 0xfff00000,
  193. .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
  194. .boot_params = 0x10000100,
  195. .map_io = h3_map_io,
  196. .init_irq = h3_init_irq,
  197. .init_machine = h3_init,
  198. .timer = &omap_timer,
  199. MACHINE_END