h5000.c 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /*
  2. * Hardware definitions for HP iPAQ h5xxx Handheld Computers
  3. *
  4. * Copyright 2000-2003 Hewlett-Packard Company.
  5. * Copyright 2002 Jamey Hicks <jamey.hicks@hp.com>
  6. * Copyright 2004-2005 Phil Blundell <pb@handhelds.org>
  7. * Copyright 2007-2008 Anton Vorontsov <cbouatmailru@gmail.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
  15. * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
  16. * FITNESS FOR ANY PARTICULAR PURPOSE.
  17. *
  18. * Author: Jamey Hicks.
  19. */
  20. #include <linux/kernel.h>
  21. #include <linux/init.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/mtd/mtd.h>
  24. #include <linux/mtd/partitions.h>
  25. #include <linux/mtd/physmap.h>
  26. #include <asm/mach-types.h>
  27. #include <asm/mach/arch.h>
  28. #include <asm/mach/map.h>
  29. #include <mach/pxa25x.h>
  30. #include <mach/h5000.h>
  31. #include <mach/udc.h>
  32. #include "generic.h"
  33. /*
  34. * Flash
  35. */
  36. static struct mtd_partition h5000_flash0_partitions[] = {
  37. {
  38. .name = "bootldr",
  39. .size = 0x00040000,
  40. .offset = 0,
  41. .mask_flags = MTD_WRITEABLE,
  42. },
  43. {
  44. .name = "root",
  45. .size = MTDPART_SIZ_FULL,
  46. .offset = MTDPART_OFS_APPEND,
  47. },
  48. };
  49. static struct mtd_partition h5000_flash1_partitions[] = {
  50. {
  51. .name = "second root",
  52. .size = SZ_16M - 0x00040000,
  53. .offset = 0,
  54. },
  55. {
  56. .name = "asset",
  57. .size = MTDPART_SIZ_FULL,
  58. .offset = MTDPART_OFS_APPEND,
  59. .mask_flags = MTD_WRITEABLE,
  60. },
  61. };
  62. static struct physmap_flash_data h5000_flash0_data = {
  63. .width = 4,
  64. .parts = h5000_flash0_partitions,
  65. .nr_parts = ARRAY_SIZE(h5000_flash0_partitions),
  66. };
  67. static struct physmap_flash_data h5000_flash1_data = {
  68. .width = 4,
  69. .parts = h5000_flash1_partitions,
  70. .nr_parts = ARRAY_SIZE(h5000_flash1_partitions),
  71. };
  72. static struct resource h5000_flash0_resources = {
  73. .start = PXA_CS0_PHYS,
  74. .end = PXA_CS0_PHYS + SZ_32M - 1,
  75. .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
  76. };
  77. static struct resource h5000_flash1_resources = {
  78. .start = PXA_CS0_PHYS + SZ_32M,
  79. .end = PXA_CS0_PHYS + SZ_32M + SZ_16M - 1,
  80. .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
  81. };
  82. static struct platform_device h5000_flash[] = {
  83. {
  84. .name = "physmap-flash",
  85. .id = 0,
  86. .resource = &h5000_flash0_resources,
  87. .num_resources = 1,
  88. .dev = {
  89. .platform_data = &h5000_flash0_data,
  90. },
  91. },
  92. {
  93. .name = "physmap-flash",
  94. .id = 1,
  95. .resource = &h5000_flash1_resources,
  96. .num_resources = 1,
  97. .dev = {
  98. .platform_data = &h5000_flash1_data,
  99. },
  100. },
  101. };
  102. /*
  103. * USB Device Controller
  104. */
  105. static struct pxa2xx_udc_mach_info h5000_udc_mach_info __initdata = {
  106. .gpio_pullup = H5000_GPIO_USB_PULLUP,
  107. };
  108. /*
  109. * GPIO setup
  110. */
  111. static unsigned long h5000_pin_config[] __initdata = {
  112. /* Crystal and Clock Signals */
  113. GPIO12_32KHz,
  114. /* SDRAM and Static Memory I/O Signals */
  115. GPIO15_nCS_1,
  116. GPIO78_nCS_2,
  117. GPIO79_nCS_3,
  118. GPIO80_nCS_4,
  119. /* FFUART */
  120. GPIO34_FFUART_RXD,
  121. GPIO35_FFUART_CTS,
  122. GPIO36_FFUART_DCD,
  123. GPIO37_FFUART_DSR,
  124. GPIO38_FFUART_RI,
  125. GPIO39_FFUART_TXD,
  126. GPIO40_FFUART_DTR,
  127. GPIO41_FFUART_RTS,
  128. /* BTUART */
  129. GPIO42_BTUART_RXD,
  130. GPIO43_BTUART_TXD,
  131. GPIO44_BTUART_CTS,
  132. GPIO45_BTUART_RTS,
  133. /* SSP1 */
  134. GPIO23_SSP1_SCLK,
  135. GPIO25_SSP1_TXD,
  136. GPIO26_SSP1_RXD,
  137. /* I2S */
  138. GPIO28_I2S_BITCLK_OUT,
  139. GPIO29_I2S_SDATA_IN,
  140. GPIO30_I2S_SDATA_OUT,
  141. GPIO31_I2S_SYNC,
  142. GPIO32_I2S_SYSCLK,
  143. };
  144. /*
  145. * Localbus setup:
  146. * CS0: Flash;
  147. * CS1: MediaQ chip, select 16-bit bus and vlio;
  148. * CS5: SAMCOP.
  149. */
  150. static void fix_msc(void)
  151. {
  152. MSC0 = 0x129c24f2;
  153. MSC1 = 0x7ff424fa;
  154. MSC2 = 0x7ff47ff4;
  155. MDREFR |= 0x02080000;
  156. }
  157. /*
  158. * Platform devices
  159. */
  160. static struct platform_device *devices[] __initdata = {
  161. &h5000_flash[0],
  162. &h5000_flash[1],
  163. };
  164. static void __init h5000_init(void)
  165. {
  166. fix_msc();
  167. pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config));
  168. pxa_set_udc_info(&h5000_udc_mach_info);
  169. platform_add_devices(ARRAY_AND_SIZE(devices));
  170. }
  171. MACHINE_START(H5400, "HP iPAQ H5000")
  172. .phys_io = 0x40000000,
  173. .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
  174. .boot_params = 0xa0000100,
  175. .map_io = pxa_map_io,
  176. .init_irq = pxa25x_init_irq,
  177. .timer = &pxa_timer,
  178. .init_machine = h5000_init,
  179. MACHINE_END