jasper.c 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. * linux/arch/arm/mach-mmp/jasper.c
  3. *
  4. * Support for the Marvell Jasper Development Platform.
  5. *
  6. * Copyright (C) 2009-2010 Marvell International Ltd.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * publishhed by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/kernel.h>
  14. #include <linux/gpio-pxa.h>
  15. #include <linux/platform_device.h>
  16. #include <linux/io.h>
  17. #include <linux/regulator/machine.h>
  18. #include <linux/regulator/max8649.h>
  19. #include <linux/mfd/max8925.h>
  20. #include <linux/interrupt.h>
  21. #include "irqs.h"
  22. #include <asm/mach-types.h>
  23. #include <asm/mach/arch.h>
  24. #include "addr-map.h"
  25. #include "mfp-mmp2.h"
  26. #include "mmp2.h"
  27. #include "common.h"
  28. #define JASPER_NR_IRQS (MMP_NR_IRQS + 48)
  29. static unsigned long jasper_pin_config[] __initdata = {
  30. /* UART1 */
  31. GPIO29_UART1_RXD,
  32. GPIO30_UART1_TXD,
  33. /* UART3 */
  34. GPIO51_UART3_RXD,
  35. GPIO52_UART3_TXD,
  36. /* DFI */
  37. GPIO168_DFI_D0,
  38. GPIO167_DFI_D1,
  39. GPIO166_DFI_D2,
  40. GPIO165_DFI_D3,
  41. GPIO107_DFI_D4,
  42. GPIO106_DFI_D5,
  43. GPIO105_DFI_D6,
  44. GPIO104_DFI_D7,
  45. GPIO111_DFI_D8,
  46. GPIO164_DFI_D9,
  47. GPIO163_DFI_D10,
  48. GPIO162_DFI_D11,
  49. GPIO161_DFI_D12,
  50. GPIO110_DFI_D13,
  51. GPIO109_DFI_D14,
  52. GPIO108_DFI_D15,
  53. GPIO143_ND_nCS0,
  54. GPIO144_ND_nCS1,
  55. GPIO147_ND_nWE,
  56. GPIO148_ND_nRE,
  57. GPIO150_ND_ALE,
  58. GPIO149_ND_CLE,
  59. GPIO112_ND_RDY0,
  60. GPIO160_ND_RDY1,
  61. /* PMIC */
  62. PMIC_PMIC_INT | MFP_LPM_EDGE_FALL,
  63. /* MMC1 */
  64. GPIO131_MMC1_DAT3,
  65. GPIO132_MMC1_DAT2,
  66. GPIO133_MMC1_DAT1,
  67. GPIO134_MMC1_DAT0,
  68. GPIO136_MMC1_CMD,
  69. GPIO139_MMC1_CLK,
  70. GPIO140_MMC1_CD,
  71. GPIO141_MMC1_WP,
  72. /* MMC2 */
  73. GPIO37_MMC2_DAT3,
  74. GPIO38_MMC2_DAT2,
  75. GPIO39_MMC2_DAT1,
  76. GPIO40_MMC2_DAT0,
  77. GPIO41_MMC2_CMD,
  78. GPIO42_MMC2_CLK,
  79. /* MMC3 */
  80. GPIO165_MMC3_DAT7,
  81. GPIO162_MMC3_DAT6,
  82. GPIO166_MMC3_DAT5,
  83. GPIO163_MMC3_DAT4,
  84. GPIO167_MMC3_DAT3,
  85. GPIO164_MMC3_DAT2,
  86. GPIO168_MMC3_DAT1,
  87. GPIO111_MMC3_DAT0,
  88. GPIO112_MMC3_CMD,
  89. GPIO151_MMC3_CLK,
  90. };
  91. static struct pxa_gpio_platform_data mmp2_gpio_pdata = {
  92. .irq_base = MMP_GPIO_TO_IRQ(0),
  93. };
  94. static struct regulator_consumer_supply max8649_supply[] = {
  95. REGULATOR_SUPPLY("vcc_core", NULL),
  96. };
  97. static struct regulator_init_data max8649_init_data = {
  98. .constraints = {
  99. .name = "vcc_core range",
  100. .min_uV = 1150000,
  101. .max_uV = 1280000,
  102. .always_on = 1,
  103. .boot_on = 1,
  104. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  105. },
  106. .num_consumer_supplies = 1,
  107. .consumer_supplies = &max8649_supply[0],
  108. };
  109. static struct max8649_platform_data jasper_max8649_info = {
  110. .mode = 2, /* VID1 = 1, VID0 = 0 */
  111. .extclk = 0,
  112. .ramp_timing = MAX8649_RAMP_32MV,
  113. .regulator = &max8649_init_data,
  114. };
  115. static struct max8925_backlight_pdata jasper_backlight_data = {
  116. .dual_string = 0,
  117. };
  118. static struct max8925_power_pdata jasper_power_data = {
  119. .batt_detect = 0, /* can't detect battery by ID pin */
  120. .topoff_threshold = MAX8925_TOPOFF_THR_10PER,
  121. .fast_charge = MAX8925_FCHG_1000MA,
  122. };
  123. static struct max8925_platform_data jasper_max8925_info = {
  124. .backlight = &jasper_backlight_data,
  125. .power = &jasper_power_data,
  126. .irq_base = MMP_NR_IRQS,
  127. };
  128. static struct i2c_board_info jasper_twsi1_info[] = {
  129. [0] = {
  130. .type = "max8649",
  131. .addr = 0x60,
  132. .platform_data = &jasper_max8649_info,
  133. },
  134. [1] = {
  135. .type = "max8925",
  136. .addr = 0x3c,
  137. .irq = IRQ_MMP2_PMIC,
  138. .platform_data = &jasper_max8925_info,
  139. },
  140. };
  141. static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = {
  142. .clk_delay_cycles = 0x1f,
  143. };
  144. static void __init jasper_init(void)
  145. {
  146. mfp_config(ARRAY_AND_SIZE(jasper_pin_config));
  147. /* on-chip devices */
  148. mmp2_add_uart(1);
  149. mmp2_add_uart(3);
  150. mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info));
  151. platform_device_add_data(&mmp2_device_gpio, &mmp2_gpio_pdata,
  152. sizeof(struct pxa_gpio_platform_data));
  153. platform_device_register(&mmp2_device_gpio);
  154. mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */
  155. regulator_has_full_constraints();
  156. }
  157. MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
  158. .map_io = mmp_map_io,
  159. .nr_irqs = JASPER_NR_IRQS,
  160. .init_irq = mmp2_init_irq,
  161. .init_time = mmp2_timer_init,
  162. .init_machine = jasper_init,
  163. .restart = mmp_restart,
  164. MACHINE_END