board-h3.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  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/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 int __initdata h3_serial_ports[OMAP_MAX_NR_PORTS] = {1, 1, 1};
  40. static struct mtd_partition h3_partitions[] = {
  41. /* bootloader (U-Boot, etc) in first sector */
  42. {
  43. .name = "bootloader",
  44. .offset = 0,
  45. .size = SZ_128K,
  46. .mask_flags = MTD_WRITEABLE, /* force read-only */
  47. },
  48. /* bootloader params in the next sector */
  49. {
  50. .name = "params",
  51. .offset = MTDPART_OFS_APPEND,
  52. .size = SZ_128K,
  53. .mask_flags = 0,
  54. },
  55. /* kernel */
  56. {
  57. .name = "kernel",
  58. .offset = MTDPART_OFS_APPEND,
  59. .size = SZ_2M,
  60. .mask_flags = 0
  61. },
  62. /* file system */
  63. {
  64. .name = "filesystem",
  65. .offset = MTDPART_OFS_APPEND,
  66. .size = MTDPART_SIZ_FULL,
  67. .mask_flags = 0
  68. }
  69. };
  70. static struct flash_platform_data h3_flash_data = {
  71. .map_name = "cfi_probe",
  72. .width = 2,
  73. .parts = h3_partitions,
  74. .nr_parts = ARRAY_SIZE(h3_partitions),
  75. };
  76. static struct resource h3_flash_resource = {
  77. /* This is on CS3, wherever it's mapped */
  78. .flags = IORESOURCE_MEM,
  79. };
  80. static struct platform_device flash_device = {
  81. .name = "omapflash",
  82. .id = 0,
  83. .dev = {
  84. .platform_data = &h3_flash_data,
  85. },
  86. .num_resources = 1,
  87. .resource = &h3_flash_resource,
  88. };
  89. static struct resource smc91x_resources[] = {
  90. [0] = {
  91. .start = OMAP1710_ETHR_START, /* Physical */
  92. .end = OMAP1710_ETHR_START + 0xf,
  93. .flags = IORESOURCE_MEM,
  94. },
  95. [1] = {
  96. .start = OMAP_GPIO_IRQ(40),
  97. .end = OMAP_GPIO_IRQ(40),
  98. .flags = IORESOURCE_IRQ,
  99. },
  100. };
  101. static struct platform_device smc91x_device = {
  102. .name = "smc91x",
  103. .id = 0,
  104. .num_resources = ARRAY_SIZE(smc91x_resources),
  105. .resource = smc91x_resources,
  106. };
  107. #define GPTIMER_BASE 0xFFFB1400
  108. #define GPTIMER_REGS(x) (0xFFFB1400 + (x * 0x800))
  109. #define GPTIMER_REGS_SIZE 0x46
  110. static struct resource intlat_resources[] = {
  111. [0] = {
  112. .start = GPTIMER_REGS(0), /* Physical */
  113. .end = GPTIMER_REGS(0) + GPTIMER_REGS_SIZE,
  114. .flags = IORESOURCE_MEM,
  115. },
  116. [1] = {
  117. .start = INT_1610_GPTIMER1,
  118. .end = INT_1610_GPTIMER1,
  119. .flags = IORESOURCE_IRQ,
  120. },
  121. };
  122. static struct platform_device intlat_device = {
  123. .name = "omap_intlat",
  124. .id = 0,
  125. .num_resources = ARRAY_SIZE(intlat_resources),
  126. .resource = intlat_resources,
  127. };
  128. static struct platform_device *devices[] __initdata = {
  129. &flash_device,
  130. &smc91x_device,
  131. &intlat_device,
  132. };
  133. static struct omap_usb_config h3_usb_config __initdata = {
  134. /* usb1 has a Mini-AB port and external isp1301 transceiver */
  135. .otg = 2,
  136. #ifdef CONFIG_USB_GADGET_OMAP
  137. .hmc_mode = 19, /* 0:host(off) 1:dev|otg 2:disabled */
  138. #elif defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  139. /* NONSTANDARD CABLE NEEDED (B-to-Mini-B) */
  140. .hmc_mode = 20, /* 1:dev|otg(off) 1:host 2:disabled */
  141. #endif
  142. .pins[1] = 3,
  143. };
  144. static struct omap_mmc_config h3_mmc_config __initdata = {
  145. .mmc[0] = {
  146. .enabled = 1,
  147. .power_pin = -1, /* tps65010 GPIO4 */
  148. .switch_pin = OMAP_MPUIO(1),
  149. },
  150. };
  151. static struct omap_board_config_kernel h3_config[] = {
  152. { OMAP_TAG_USB, &h3_usb_config },
  153. { OMAP_TAG_MMC, &h3_mmc_config },
  154. };
  155. static void __init h3_init(void)
  156. {
  157. h3_flash_resource.end = h3_flash_resource.start = omap_cs3_phys();
  158. h3_flash_resource.end += OMAP_CS3_SIZE - 1;
  159. (void) platform_add_devices(devices, ARRAY_SIZE(devices));
  160. omap_board_config = h3_config;
  161. omap_board_config_size = ARRAY_SIZE(h3_config);
  162. }
  163. static void __init h3_init_smc91x(void)
  164. {
  165. omap_cfg_reg(W15_1710_GPIO40);
  166. if (omap_request_gpio(40) < 0) {
  167. printk("Error requesting gpio 40 for smc91x irq\n");
  168. return;
  169. }
  170. }
  171. void h3_init_irq(void)
  172. {
  173. omap_init_irq();
  174. omap_gpio_init();
  175. h3_init_smc91x();
  176. }
  177. static void __init h3_map_io(void)
  178. {
  179. omap_map_common_io();
  180. omap_serial_init(h3_serial_ports);
  181. }
  182. MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board")
  183. /* Maintainer: Texas Instruments, Inc. */
  184. .phys_ram = 0x10000000,
  185. .phys_io = 0xfff00000,
  186. .io_pg_offst = ((0xfef00000) >> 18) & 0xfffc,
  187. .boot_params = 0x10000100,
  188. .map_io = h3_map_io,
  189. .init_irq = h3_init_irq,
  190. .init_machine = h3_init,
  191. .timer = &omap_timer,
  192. MACHINE_END