h5000.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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 <mach/smemc.h>
  33. #include "generic.h"
  34. /*
  35. * Flash
  36. */
  37. static struct mtd_partition h5000_flash0_partitions[] = {
  38. {
  39. .name = "bootldr",
  40. .size = 0x00040000,
  41. .offset = 0,
  42. .mask_flags = MTD_WRITEABLE,
  43. },
  44. {
  45. .name = "root",
  46. .size = MTDPART_SIZ_FULL,
  47. .offset = MTDPART_OFS_APPEND,
  48. },
  49. };
  50. static struct mtd_partition h5000_flash1_partitions[] = {
  51. {
  52. .name = "second root",
  53. .size = SZ_16M - 0x00040000,
  54. .offset = 0,
  55. },
  56. {
  57. .name = "asset",
  58. .size = MTDPART_SIZ_FULL,
  59. .offset = MTDPART_OFS_APPEND,
  60. .mask_flags = MTD_WRITEABLE,
  61. },
  62. };
  63. static struct physmap_flash_data h5000_flash0_data = {
  64. .width = 4,
  65. .parts = h5000_flash0_partitions,
  66. .nr_parts = ARRAY_SIZE(h5000_flash0_partitions),
  67. };
  68. static struct physmap_flash_data h5000_flash1_data = {
  69. .width = 4,
  70. .parts = h5000_flash1_partitions,
  71. .nr_parts = ARRAY_SIZE(h5000_flash1_partitions),
  72. };
  73. static struct resource h5000_flash0_resources = {
  74. .start = PXA_CS0_PHYS,
  75. .end = PXA_CS0_PHYS + SZ_32M - 1,
  76. .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
  77. };
  78. static struct resource h5000_flash1_resources = {
  79. .start = PXA_CS0_PHYS + SZ_32M,
  80. .end = PXA_CS0_PHYS + SZ_32M + SZ_16M - 1,
  81. .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
  82. };
  83. static struct platform_device h5000_flash[] = {
  84. {
  85. .name = "physmap-flash",
  86. .id = 0,
  87. .resource = &h5000_flash0_resources,
  88. .num_resources = 1,
  89. .dev = {
  90. .platform_data = &h5000_flash0_data,
  91. },
  92. },
  93. {
  94. .name = "physmap-flash",
  95. .id = 1,
  96. .resource = &h5000_flash1_resources,
  97. .num_resources = 1,
  98. .dev = {
  99. .platform_data = &h5000_flash1_data,
  100. },
  101. },
  102. };
  103. /*
  104. * USB Device Controller
  105. */
  106. static struct pxa2xx_udc_mach_info h5000_udc_mach_info __initdata = {
  107. .gpio_pullup = H5000_GPIO_USB_PULLUP,
  108. };
  109. /*
  110. * GPIO setup
  111. */
  112. static unsigned long h5000_pin_config[] __initdata = {
  113. /* Crystal and Clock Signals */
  114. GPIO12_32KHz,
  115. /* SDRAM and Static Memory I/O Signals */
  116. GPIO15_nCS_1,
  117. GPIO78_nCS_2,
  118. GPIO79_nCS_3,
  119. GPIO80_nCS_4,
  120. /* FFUART */
  121. GPIO34_FFUART_RXD,
  122. GPIO35_FFUART_CTS,
  123. GPIO36_FFUART_DCD,
  124. GPIO37_FFUART_DSR,
  125. GPIO38_FFUART_RI,
  126. GPIO39_FFUART_TXD,
  127. GPIO40_FFUART_DTR,
  128. GPIO41_FFUART_RTS,
  129. /* BTUART */
  130. GPIO42_BTUART_RXD,
  131. GPIO43_BTUART_TXD,
  132. GPIO44_BTUART_CTS,
  133. GPIO45_BTUART_RTS,
  134. /* SSP1 */
  135. GPIO23_SSP1_SCLK,
  136. GPIO25_SSP1_TXD,
  137. GPIO26_SSP1_RXD,
  138. /* I2S */
  139. GPIO28_I2S_BITCLK_OUT,
  140. GPIO29_I2S_SDATA_IN,
  141. GPIO30_I2S_SDATA_OUT,
  142. GPIO31_I2S_SYNC,
  143. GPIO32_I2S_SYSCLK,
  144. };
  145. /*
  146. * Localbus setup:
  147. * CS0: Flash;
  148. * CS1: MediaQ chip, select 16-bit bus and vlio;
  149. * CS5: SAMCOP.
  150. */
  151. static void fix_msc(void)
  152. {
  153. __raw_writel(0x129c24f2, MSC0);
  154. __raw_writel(0x7ff424fa, MSC1);
  155. __raw_writel(0x7ff47ff4, MSC2);
  156. __raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR);
  157. }
  158. /*
  159. * Platform devices
  160. */
  161. static struct platform_device *devices[] __initdata = {
  162. &h5000_flash[0],
  163. &h5000_flash[1],
  164. };
  165. static void __init h5000_init(void)
  166. {
  167. fix_msc();
  168. pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config));
  169. pxa_set_ffuart_info(NULL);
  170. pxa_set_btuart_info(NULL);
  171. pxa_set_stuart_info(NULL);
  172. pxa_set_udc_info(&h5000_udc_mach_info);
  173. platform_add_devices(ARRAY_AND_SIZE(devices));
  174. }
  175. MACHINE_START(H5400, "HP iPAQ H5000")
  176. .boot_params = 0xa0000100,
  177. .map_io = pxa25x_map_io,
  178. .init_irq = pxa25x_init_irq,
  179. .timer = &pxa_timer,
  180. .init_machine = h5000_init,
  181. MACHINE_END