jasper.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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/platform_device.h>
  15. #include <linux/io.h>
  16. #include <linux/gpio.h>
  17. #include <linux/regulator/machine.h>
  18. #include <linux/regulator/max8649.h>
  19. #include <linux/mfd/max8925.h>
  20. #include <asm/mach-types.h>
  21. #include <asm/mach/arch.h>
  22. #include <mach/addr-map.h>
  23. #include <mach/mfp-mmp2.h>
  24. #include <mach/mmp2.h>
  25. #include <mach/irqs.h>
  26. #include "common.h"
  27. static unsigned long jasper_pin_config[] __initdata = {
  28. /* UART1 */
  29. GPIO29_UART1_RXD,
  30. GPIO30_UART1_TXD,
  31. /* UART3 */
  32. GPIO51_UART3_RXD,
  33. GPIO52_UART3_TXD,
  34. /* DFI */
  35. GPIO168_DFI_D0,
  36. GPIO167_DFI_D1,
  37. GPIO166_DFI_D2,
  38. GPIO165_DFI_D3,
  39. GPIO107_DFI_D4,
  40. GPIO106_DFI_D5,
  41. GPIO105_DFI_D6,
  42. GPIO104_DFI_D7,
  43. GPIO111_DFI_D8,
  44. GPIO164_DFI_D9,
  45. GPIO163_DFI_D10,
  46. GPIO162_DFI_D11,
  47. GPIO161_DFI_D12,
  48. GPIO110_DFI_D13,
  49. GPIO109_DFI_D14,
  50. GPIO108_DFI_D15,
  51. GPIO143_ND_nCS0,
  52. GPIO144_ND_nCS1,
  53. GPIO147_ND_nWE,
  54. GPIO148_ND_nRE,
  55. GPIO150_ND_ALE,
  56. GPIO149_ND_CLE,
  57. GPIO112_ND_RDY0,
  58. GPIO160_ND_RDY1,
  59. /* PMIC */
  60. PMIC_PMIC_INT | MFP_LPM_EDGE_FALL,
  61. };
  62. static struct regulator_consumer_supply max8649_supply[] = {
  63. REGULATOR_SUPPLY("vcc_core", NULL),
  64. };
  65. static struct regulator_init_data max8649_init_data = {
  66. .constraints = {
  67. .name = "vcc_core range",
  68. .min_uV = 1150000,
  69. .max_uV = 1280000,
  70. .always_on = 1,
  71. .boot_on = 1,
  72. .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
  73. },
  74. .num_consumer_supplies = 1,
  75. .consumer_supplies = &max8649_supply[0],
  76. };
  77. static struct max8649_platform_data jasper_max8649_info = {
  78. .mode = 2, /* VID1 = 1, VID0 = 0 */
  79. .extclk = 0,
  80. .ramp_timing = MAX8649_RAMP_32MV,
  81. .regulator = &max8649_init_data,
  82. };
  83. static struct max8925_backlight_pdata jasper_backlight_data = {
  84. .dual_string = 0,
  85. };
  86. static struct max8925_power_pdata jasper_power_data = {
  87. .batt_detect = 0, /* can't detect battery by ID pin */
  88. .topoff_threshold = MAX8925_TOPOFF_THR_10PER,
  89. .fast_charge = MAX8925_FCHG_1000MA,
  90. };
  91. static struct max8925_platform_data jasper_max8925_info = {
  92. .backlight = &jasper_backlight_data,
  93. .power = &jasper_power_data,
  94. .irq_base = IRQ_BOARD_START,
  95. };
  96. static struct i2c_board_info jasper_twsi1_info[] = {
  97. [0] = {
  98. .type = "max8649",
  99. .addr = 0x60,
  100. .platform_data = &jasper_max8649_info,
  101. },
  102. [1] = {
  103. .type = "max8925",
  104. .addr = 0x3c,
  105. .irq = IRQ_MMP2_PMIC,
  106. .platform_data = &jasper_max8925_info,
  107. },
  108. };
  109. static void __init jasper_init(void)
  110. {
  111. mfp_config(ARRAY_AND_SIZE(jasper_pin_config));
  112. /* on-chip devices */
  113. mmp2_add_uart(1);
  114. mmp2_add_uart(3);
  115. mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info));
  116. regulator_has_full_constraints();
  117. }
  118. MACHINE_START(MARVELL_JASPER, "Jasper Development Platform")
  119. .phys_io = APB_PHYS_BASE,
  120. .io_pg_offst = (APB_VIRT_BASE >> 18) & 0xfffc,
  121. .map_io = mmp_map_io,
  122. .init_irq = mmp2_init_irq,
  123. .timer = &mmp2_timer,
  124. .init_machine = jasper_init,
  125. MACHINE_END