aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
authorMichael Williamson <michael.williamson@criticallink.com>2010-09-05 13:29:39 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-09-24 10:40:29 -0400
commit8774882394190fe52d1df449b1e1c6cff9c3088c (patch)
treed5af8c6b974617863901ec56e28f376d2f6bed13 /arch/arm/mach-davinci
parentb41547c153436712daef544c0f18547fcb70f4ac (diff)
davinci: Add I2C0 devices to MityDSP-L138/MityARM-1808 platform
This patch adds the i2c0 bus and attached devices to the MityDSP-L138 and MityARM-1808 davinci SoM. Included is a TPS65023 voltage regulator needed for power management and a small 24c02 EPROM that contains factory configuration data. Signed-off-by: Michael Williamson <michael.williamson@criticallink.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/board-mityomapl138.c145
1 files changed, 145 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 7146916fa498..84d5aff50de4 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -13,6 +13,8 @@
13#include <linux/console.h> 13#include <linux/console.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/mtd/partitions.h> 15#include <linux/mtd/partitions.h>
16#include <linux/regulator/machine.h>
17#include <linux/i2c.h>
16 18
17#include <asm/mach-types.h> 19#include <asm/mach-types.h>
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
@@ -25,6 +27,141 @@
25#define MITYOMAPL138_PHY_MASK 0x08 /* hardcoded for now */ 27#define MITYOMAPL138_PHY_MASK 0x08 /* hardcoded for now */
26#define MITYOMAPL138_MDIO_FREQUENCY (2200000) /* PHY bus frequency */ 28#define MITYOMAPL138_MDIO_FREQUENCY (2200000) /* PHY bus frequency */
27 29
30static struct davinci_i2c_platform_data mityomap_i2c_0_pdata = {
31 .bus_freq = 100, /* kHz */
32 .bus_delay = 0, /* usec */
33};
34
35/* TPS65023 voltage regulator support */
36/* 1.2V Core */
37struct regulator_consumer_supply tps65023_dcdc1_consumers[] = {
38 {
39 .supply = "cvdd",
40 },
41};
42
43/* 1.8V */
44struct regulator_consumer_supply tps65023_dcdc2_consumers[] = {
45 {
46 .supply = "usb0_vdda18",
47 },
48 {
49 .supply = "usb1_vdda18",
50 },
51 {
52 .supply = "ddr_dvdd18",
53 },
54 {
55 .supply = "sata_vddr",
56 },
57};
58
59/* 1.2V */
60struct regulator_consumer_supply tps65023_dcdc3_consumers[] = {
61 {
62 .supply = "sata_vdd",
63 },
64 {
65 .supply = "usb_cvdd",
66 },
67 {
68 .supply = "pll0_vdda",
69 },
70 {
71 .supply = "pll1_vdda",
72 },
73};
74
75/* 1.8V Aux LDO, not used */
76struct regulator_consumer_supply tps65023_ldo1_consumers[] = {
77 {
78 .supply = "1.8v_aux",
79 },
80};
81
82/* FPGA VCC Aux (2.5 or 3.3) LDO */
83struct regulator_consumer_supply tps65023_ldo2_consumers[] = {
84 {
85 .supply = "vccaux",
86 },
87};
88
89struct regulator_init_data tps65023_regulator_data[] = {
90 /* dcdc1 */
91 {
92 .constraints = {
93 .min_uV = 1150000,
94 .max_uV = 1350000,
95 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
96 REGULATOR_CHANGE_STATUS,
97 .boot_on = 1,
98 },
99 .num_consumer_supplies = ARRAY_SIZE(tps65023_dcdc1_consumers),
100 .consumer_supplies = tps65023_dcdc1_consumers,
101 },
102 /* dcdc2 */
103 {
104 .constraints = {
105 .min_uV = 1800000,
106 .max_uV = 1800000,
107 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
108 .boot_on = 1,
109 },
110 .num_consumer_supplies = ARRAY_SIZE(tps65023_dcdc2_consumers),
111 .consumer_supplies = tps65023_dcdc2_consumers,
112 },
113 /* dcdc3 */
114 {
115 .constraints = {
116 .min_uV = 1200000,
117 .max_uV = 1200000,
118 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
119 .boot_on = 1,
120 },
121 .num_consumer_supplies = ARRAY_SIZE(tps65023_dcdc3_consumers),
122 .consumer_supplies = tps65023_dcdc3_consumers,
123 },
124 /* ldo1 */
125 {
126 .constraints = {
127 .min_uV = 1800000,
128 .max_uV = 1800000,
129 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
130 .boot_on = 1,
131 },
132 .num_consumer_supplies = ARRAY_SIZE(tps65023_ldo1_consumers),
133 .consumer_supplies = tps65023_ldo1_consumers,
134 },
135 /* ldo2 */
136 {
137 .constraints = {
138 .min_uV = 2500000,
139 .max_uV = 3300000,
140 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
141 REGULATOR_CHANGE_STATUS,
142 .boot_on = 1,
143 },
144 .num_consumer_supplies = ARRAY_SIZE(tps65023_ldo2_consumers),
145 .consumer_supplies = tps65023_ldo2_consumers,
146 },
147};
148
149static struct i2c_board_info __initdata mityomap_tps65023_info[] = {
150 {
151 I2C_BOARD_INFO("tps65023", 0x48),
152 .platform_data = &tps65023_regulator_data[0],
153 },
154 {
155 I2C_BOARD_INFO("24c02", 0x50),
156 },
157};
158
159static int __init pmic_tps65023_init(void)
160{
161 return i2c_register_board_info(1, mityomap_tps65023_info,
162 ARRAY_SIZE(mityomap_tps65023_info));
163}
164
28/* 165/*
29 * MityDSP-L138 includes a 256 MByte large-page NAND flash 166 * MityDSP-L138 includes a 256 MByte large-page NAND flash
30 * (128K blocks). 167 * (128K blocks).
@@ -172,6 +309,14 @@ static void __init mityomapl138_init(void)
172 309
173 davinci_serial_init(&mityomapl138_uart_config); 310 davinci_serial_init(&mityomapl138_uart_config);
174 311
312 ret = da8xx_register_i2c(0, &mityomap_i2c_0_pdata);
313 if (ret)
314 pr_warning("i2c0 registration failed: %d\n", ret);
315
316 ret = pmic_tps65023_init();
317 if (ret)
318 pr_warning("TPS65023 PMIC init failed: %d\n", ret);
319
175 mityomapl138_setup_nand(); 320 mityomapl138_setup_nand();
176 321
177 mityomapl138_config_emac(); 322 mityomapl138_config_emac();