Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 1 | |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2008-2009 ST-Ericsson |
| 4 | * |
| 5 | * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com> |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2, as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | */ |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/interrupt.h> |
| 15 | #include <linux/platform_device.h> |
| 16 | #include <linux/io.h> |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 17 | #include <linux/i2c.h> |
Rabin Vincent | ea05a57 | 2010-06-03 07:58:42 +0100 | [diff] [blame] | 18 | #include <linux/gpio.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 19 | #include <linux/amba/bus.h> |
| 20 | #include <linux/amba/pl022.h> |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 21 | #include <linux/amba/serial.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 22 | #include <linux/spi/spi.h> |
Linus Walleij | ee66e65 | 2011-12-02 14:16:33 +0100 | [diff] [blame] | 23 | #include <linux/mfd/abx500/ab8500.h> |
Bengt Jonsson | 79568b94 | 2011-03-11 11:54:46 +0100 | [diff] [blame] | 24 | #include <linux/regulator/ab8500.h> |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 25 | #include <linux/mfd/tc3589x.h> |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 26 | #include <linux/mfd/tps6105x.h> |
Linus Walleij | ee66e65 | 2011-12-02 14:16:33 +0100 | [diff] [blame] | 27 | #include <linux/mfd/abx500/ab8500-gpio.h> |
Ola Lilja | f242e50 | 2012-06-07 14:00:46 +0200 | [diff] [blame^] | 28 | #include <linux/mfd/abx500/ab8500-codec.h> |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 29 | #include <linux/leds-lp5521.h> |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 30 | #include <linux/input.h> |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 31 | #include <linux/smsc911x.h> |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 32 | #include <linux/gpio_keys.h> |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 33 | #include <linux/delay.h> |
Arnd Bergmann | 2d33429 | 2012-03-07 15:04:07 +0000 | [diff] [blame] | 34 | #include <linux/of.h> |
| 35 | #include <linux/of_platform.h> |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 36 | #include <linux/leds.h> |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 37 | #include <linux/pinctrl/consumer.h> |
| 38 | |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 39 | #include <asm/mach-types.h> |
| 40 | #include <asm/mach/arch.h> |
Marc Zyngier | bbf5f38 | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 41 | #include <asm/hardware/gic.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 42 | |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 43 | #include <plat/i2c.h> |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 44 | #include <plat/ste_dma40.h> |
Linus Walleij | 0f33286 | 2011-08-22 08:33:30 +0100 | [diff] [blame] | 45 | #include <plat/gpio-nomadik.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 46 | |
| 47 | #include <mach/hardware.h> |
| 48 | #include <mach/setup.h> |
Rabin Vincent | 9e4e7fe | 2010-05-03 08:03:52 +0100 | [diff] [blame] | 49 | #include <mach/devices.h> |
Linus Walleij | 29aeb3c | 2010-09-06 22:15:08 +0100 | [diff] [blame] | 50 | #include <mach/irqs.h> |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 51 | #include <mach/crypto-ux500.h> |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 52 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 53 | #include "ste-dma40-db8500.h" |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 54 | #include "devices-db8500.h" |
Hanumath Prasad | 008f8a2 | 2010-08-19 12:06:32 +0100 | [diff] [blame] | 55 | #include "board-mop500.h" |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 56 | #include "board-mop500-regulators.h" |
Ola Lilja | c0af14d | 2012-04-20 11:32:59 +0200 | [diff] [blame] | 57 | #include "board-mop500-msp.h" |
Rabin Vincent | ea05a57 | 2010-06-03 07:58:42 +0100 | [diff] [blame] | 58 | |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 59 | static struct gpio_led snowball_led_array[] = { |
| 60 | { |
| 61 | .name = "user_led", |
| 62 | .default_trigger = "none", |
| 63 | .gpio = 142, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct gpio_led_platform_data snowball_led_data = { |
| 68 | .leds = snowball_led_array, |
| 69 | .num_leds = ARRAY_SIZE(snowball_led_array), |
| 70 | }; |
| 71 | |
| 72 | static struct platform_device snowball_led_dev = { |
| 73 | .name = "leds-gpio", |
| 74 | .dev = { |
| 75 | .platform_data = &snowball_led_data, |
| 76 | }, |
| 77 | }; |
| 78 | |
Bibek Basu | 3ef374a | 2011-02-15 12:56:16 +0530 | [diff] [blame] | 79 | static struct ab8500_gpio_platform_data ab8500_gpio_pdata = { |
Philippe Langlais | a1524ee | 2012-02-13 10:52:25 +0100 | [diff] [blame] | 80 | .gpio_base = MOP500_AB8500_PIN_GPIO(1), |
Bibek Basu | 3ef374a | 2011-02-15 12:56:16 +0530 | [diff] [blame] | 81 | .irq_base = MOP500_AB8500_VIR_GPIO_IRQ_BASE, |
| 82 | /* config_reg is the initial configuration of ab8500 pins. |
| 83 | * The pins can be configured as GPIO or alt functions based |
| 84 | * on value present in GpioSel1 to GpioSel6 and AlternatFunction |
| 85 | * register. This is the array of 7 configuration settings. |
| 86 | * One has to compile time decide these settings. Below is the |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 87 | * explanation of these setting |
Bibek Basu | 3ef374a | 2011-02-15 12:56:16 +0530 | [diff] [blame] | 88 | * GpioSel1 = 0x00 => Pins GPIO1 to GPIO8 are not used as GPIO |
| 89 | * GpioSel2 = 0x1E => Pins GPIO10 to GPIO13 are configured as GPIO |
| 90 | * GpioSel3 = 0x80 => Pin GPIO24 is configured as GPIO |
| 91 | * GpioSel4 = 0x01 => Pin GPIo25 is configured as GPIO |
| 92 | * GpioSel5 = 0x7A => Pins GPIO34, GPIO36 to GPIO39 are conf as GPIO |
| 93 | * GpioSel6 = 0x00 => Pins GPIO41 & GPIo42 are not configured as GPIO |
| 94 | * AlternaFunction = 0x00 => If Pins GPIO10 to 13 are not configured |
| 95 | * as GPIO then this register selectes the alternate fucntions |
| 96 | */ |
| 97 | .config_reg = {0x00, 0x1E, 0x80, 0x01, |
| 98 | 0x7A, 0x00, 0x00}, |
| 99 | }; |
| 100 | |
Ola Lilja | f242e50 | 2012-06-07 14:00:46 +0200 | [diff] [blame^] | 101 | /* ab8500-codec */ |
| 102 | static struct ab8500_codec_platform_data ab8500_codec_pdata = { |
| 103 | .amics = { |
| 104 | .mic1_type = AMIC_TYPE_DIFFERENTIAL, |
| 105 | .mic2_type = AMIC_TYPE_DIFFERENTIAL, |
| 106 | .mic1a_micbias = AMIC_MICBIAS_VAMIC1, |
| 107 | .mic1b_micbias = AMIC_MICBIAS_VAMIC1, |
| 108 | .mic2_micbias = AMIC_MICBIAS_VAMIC2 |
| 109 | }, |
| 110 | .ear_cmv = EAR_CMV_0_95V |
| 111 | }; |
| 112 | |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 113 | static struct gpio_keys_button snowball_key_array[] = { |
| 114 | { |
| 115 | .gpio = 32, |
| 116 | .type = EV_KEY, |
| 117 | .code = KEY_1, |
| 118 | .desc = "userpb", |
| 119 | .active_low = 1, |
| 120 | .debounce_interval = 50, |
| 121 | .wakeup = 1, |
| 122 | }, |
| 123 | { |
| 124 | .gpio = 151, |
| 125 | .type = EV_KEY, |
| 126 | .code = KEY_2, |
| 127 | .desc = "extkb1", |
| 128 | .active_low = 1, |
| 129 | .debounce_interval = 50, |
| 130 | .wakeup = 1, |
| 131 | }, |
| 132 | { |
| 133 | .gpio = 152, |
| 134 | .type = EV_KEY, |
| 135 | .code = KEY_3, |
| 136 | .desc = "extkb2", |
| 137 | .active_low = 1, |
| 138 | .debounce_interval = 50, |
| 139 | .wakeup = 1, |
| 140 | }, |
| 141 | { |
| 142 | .gpio = 161, |
| 143 | .type = EV_KEY, |
| 144 | .code = KEY_4, |
| 145 | .desc = "extkb3", |
| 146 | .active_low = 1, |
| 147 | .debounce_interval = 50, |
| 148 | .wakeup = 1, |
| 149 | }, |
| 150 | { |
| 151 | .gpio = 162, |
| 152 | .type = EV_KEY, |
| 153 | .code = KEY_5, |
| 154 | .desc = "extkb4", |
| 155 | .active_low = 1, |
| 156 | .debounce_interval = 50, |
| 157 | .wakeup = 1, |
| 158 | }, |
| 159 | }; |
| 160 | |
| 161 | static struct gpio_keys_platform_data snowball_key_data = { |
| 162 | .buttons = snowball_key_array, |
| 163 | .nbuttons = ARRAY_SIZE(snowball_key_array), |
| 164 | }; |
| 165 | |
| 166 | static struct platform_device snowball_key_dev = { |
| 167 | .name = "gpio-keys", |
| 168 | .id = -1, |
| 169 | .dev = { |
| 170 | .platform_data = &snowball_key_data, |
| 171 | } |
| 172 | }; |
| 173 | |
| 174 | static struct smsc911x_platform_config snowball_sbnet_cfg = { |
| 175 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, |
| 176 | .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, |
| 177 | .flags = SMSC911X_USE_16BIT | SMSC911X_FORCE_INTERNAL_PHY, |
| 178 | .shift = 1, |
| 179 | }; |
| 180 | |
| 181 | static struct resource sbnet_res[] = { |
| 182 | { |
| 183 | .name = "smsc911x-memory", |
| 184 | .start = (0x5000 << 16), |
| 185 | .end = (0x5000 << 16) + 0xffff, |
| 186 | .flags = IORESOURCE_MEM, |
| 187 | }, |
| 188 | { |
| 189 | .start = NOMADIK_GPIO_TO_IRQ(140), |
| 190 | .end = NOMADIK_GPIO_TO_IRQ(140), |
| 191 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
| 192 | }, |
| 193 | }; |
| 194 | |
| 195 | static struct platform_device snowball_sbnet_dev = { |
| 196 | .name = "smsc911x", |
| 197 | .num_resources = ARRAY_SIZE(sbnet_res), |
| 198 | .resource = sbnet_res, |
| 199 | .dev = { |
| 200 | .platform_data = &snowball_sbnet_cfg, |
| 201 | }, |
| 202 | }; |
| 203 | |
Rabin Vincent | 39ae702 | 2010-07-26 11:12:15 +0100 | [diff] [blame] | 204 | static struct ab8500_platform_data ab8500_platdata = { |
| 205 | .irq_base = MOP500_AB8500_IRQ_BASE, |
Bengt Jonsson | dfa3a82 | 2011-03-09 13:34:17 +0100 | [diff] [blame] | 206 | .regulator_reg_init = ab8500_regulator_reg_init, |
| 207 | .num_regulator_reg_init = ARRAY_SIZE(ab8500_regulator_reg_init), |
Bengt Jonsson | a1e516e | 2010-12-10 11:08:48 +0100 | [diff] [blame] | 208 | .regulator = ab8500_regulators, |
| 209 | .num_regulator = ARRAY_SIZE(ab8500_regulators), |
Bibek Basu | 3ef374a | 2011-02-15 12:56:16 +0530 | [diff] [blame] | 210 | .gpio = &ab8500_gpio_pdata, |
Ola Lilja | f242e50 | 2012-06-07 14:00:46 +0200 | [diff] [blame^] | 211 | .codec = &ab8500_codec_pdata, |
Rabin Vincent | 39ae702 | 2010-07-26 11:12:15 +0100 | [diff] [blame] | 212 | }; |
| 213 | |
Linus Walleij | 29aeb3c | 2010-09-06 22:15:08 +0100 | [diff] [blame] | 214 | static struct resource ab8500_resources[] = { |
| 215 | [0] = { |
Rabin Vincent | 22039b7 | 2010-12-08 11:07:56 +0530 | [diff] [blame] | 216 | .start = IRQ_DB8500_AB8500, |
| 217 | .end = IRQ_DB8500_AB8500, |
| 218 | .flags = IORESOURCE_IRQ |
Linus Walleij | 29aeb3c | 2010-09-06 22:15:08 +0100 | [diff] [blame] | 219 | } |
| 220 | }; |
| 221 | |
| 222 | struct platform_device ab8500_device = { |
Lee Jones | d28f1db | 2012-05-19 17:21:37 +0200 | [diff] [blame] | 223 | .name = "ab8500-core", |
Linus Walleij | 29aeb3c | 2010-09-06 22:15:08 +0100 | [diff] [blame] | 224 | .id = 0, |
| 225 | .dev = { |
| 226 | .platform_data = &ab8500_platdata, |
| 227 | }, |
| 228 | .num_resources = 1, |
| 229 | .resource = ab8500_resources, |
| 230 | }; |
| 231 | |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 232 | /* |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 233 | * TPS61052 |
| 234 | */ |
| 235 | |
| 236 | static struct tps6105x_platform_data mop500_tps61052_data = { |
| 237 | .mode = TPS6105X_MODE_VOLTAGE, |
| 238 | .regulator_data = &tps61052_regulator, |
| 239 | }; |
| 240 | |
| 241 | /* |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 242 | * TC35892 |
| 243 | */ |
| 244 | |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 245 | static void mop500_tc35892_init(struct tc3589x *tc3589x, unsigned int base) |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 246 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 247 | struct device *parent = NULL; |
| 248 | #if 0 |
| 249 | /* FIXME: Is the sdi actually part of tc3589x? */ |
| 250 | parent = tc3589x->dev; |
| 251 | #endif |
| 252 | mop500_sdi_tc35892_init(parent); |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 253 | } |
| 254 | |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 255 | static struct tc3589x_gpio_platform_data mop500_tc35892_gpio_data = { |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 256 | .gpio_base = MOP500_EGPIO(0), |
| 257 | .setup = mop500_tc35892_init, |
| 258 | }; |
| 259 | |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 260 | static struct tc3589x_platform_data mop500_tc35892_data = { |
Sundar Iyer | 611b759 | 2010-12-13 09:33:15 +0530 | [diff] [blame] | 261 | .block = TC3589x_BLOCK_GPIO, |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 262 | .gpio = &mop500_tc35892_gpio_data, |
| 263 | .irq_base = MOP500_EGPIO_IRQ_BASE, |
| 264 | }; |
| 265 | |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 266 | static struct lp5521_led_config lp5521_pri_led[] = { |
| 267 | [0] = { |
| 268 | .chan_nr = 0, |
| 269 | .led_current = 0x2f, |
| 270 | .max_current = 0x5f, |
| 271 | }, |
| 272 | [1] = { |
| 273 | .chan_nr = 1, |
| 274 | .led_current = 0x2f, |
| 275 | .max_current = 0x5f, |
| 276 | }, |
| 277 | [2] = { |
| 278 | .chan_nr = 2, |
| 279 | .led_current = 0x2f, |
| 280 | .max_current = 0x5f, |
| 281 | }, |
| 282 | }; |
| 283 | |
| 284 | static struct lp5521_platform_data __initdata lp5521_pri_data = { |
| 285 | .label = "lp5521_pri", |
| 286 | .led_config = &lp5521_pri_led[0], |
| 287 | .num_channels = 3, |
| 288 | .clock_mode = LP5521_CLOCK_EXT, |
| 289 | }; |
| 290 | |
| 291 | static struct lp5521_led_config lp5521_sec_led[] = { |
| 292 | [0] = { |
| 293 | .chan_nr = 0, |
| 294 | .led_current = 0x2f, |
| 295 | .max_current = 0x5f, |
| 296 | }, |
| 297 | [1] = { |
| 298 | .chan_nr = 1, |
| 299 | .led_current = 0x2f, |
| 300 | .max_current = 0x5f, |
| 301 | }, |
| 302 | [2] = { |
| 303 | .chan_nr = 2, |
| 304 | .led_current = 0x2f, |
| 305 | .max_current = 0x5f, |
| 306 | }, |
| 307 | }; |
| 308 | |
| 309 | static struct lp5521_platform_data __initdata lp5521_sec_data = { |
| 310 | .label = "lp5521_sec", |
| 311 | .led_config = &lp5521_sec_led[0], |
| 312 | .num_channels = 3, |
| 313 | .clock_mode = LP5521_CLOCK_EXT, |
| 314 | }; |
| 315 | |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 316 | static struct i2c_board_info __initdata mop500_i2c0_devices[] = { |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 317 | { |
Sundar Iyer | 20406eb | 2010-12-13 09:33:14 +0530 | [diff] [blame] | 318 | I2C_BOARD_INFO("tc3589x", 0x42), |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 319 | .irq = NOMADIK_GPIO_TO_IRQ(217), |
Rabin Vincent | b8410a1 | 2010-08-09 19:18:17 +0530 | [diff] [blame] | 320 | .platform_data = &mop500_tc35892_data, |
| 321 | }, |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 322 | /* I2C0 devices only available prior to HREFv60 */ |
Linus Walleij | fe67dfc | 2011-03-07 11:48:15 +0100 | [diff] [blame] | 323 | { |
| 324 | I2C_BOARD_INFO("tps61052", 0x33), |
| 325 | .platform_data = &mop500_tps61052_data, |
| 326 | }, |
| 327 | }; |
| 328 | |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 329 | #define NUM_PRE_V60_I2C0_DEVICES 1 |
| 330 | |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 331 | static struct i2c_board_info __initdata mop500_i2c2_devices[] = { |
| 332 | { |
| 333 | /* lp5521 LED driver, 1st device */ |
| 334 | I2C_BOARD_INFO("lp5521", 0x33), |
| 335 | .platform_data = &lp5521_pri_data, |
| 336 | }, |
| 337 | { |
| 338 | /* lp5521 LED driver, 2st device */ |
| 339 | I2C_BOARD_INFO("lp5521", 0x34), |
| 340 | .platform_data = &lp5521_sec_data, |
| 341 | }, |
Lee Jones | bb3b218 | 2011-01-13 14:41:22 +0000 | [diff] [blame] | 342 | { |
| 343 | /* Light sensor Rohm BH1780GLI */ |
| 344 | I2C_BOARD_INFO("bh1780", 0x29), |
| 345 | }, |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 346 | }; |
| 347 | |
Linus Walleij | 2b030bd | 2011-05-13 12:31:13 +0200 | [diff] [blame] | 348 | #define U8500_I2C_CONTROLLER(id, _slsu, _tft, _rft, clk, t_out, _sm) \ |
Rabin Vincent | f9faf23 | 2010-05-03 08:24:37 +0100 | [diff] [blame] | 349 | static struct nmk_i2c_controller u8500_i2c##id##_data = { \ |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 350 | /* \ |
| 351 | * slave data setup time, which is \ |
| 352 | * 250 ns,100ns,10ns which is 14,6,2 \ |
| 353 | * respectively for a 48 Mhz \ |
| 354 | * i2c clock \ |
| 355 | */ \ |
| 356 | .slsu = _slsu, \ |
| 357 | /* Tx FIFO threshold */ \ |
| 358 | .tft = _tft, \ |
| 359 | /* Rx FIFO threshold */ \ |
| 360 | .rft = _rft, \ |
| 361 | /* std. mode operation */ \ |
| 362 | .clk_freq = clk, \ |
Linus Walleij | 2b030bd | 2011-05-13 12:31:13 +0200 | [diff] [blame] | 363 | /* Slave response timeout(ms) */\ |
| 364 | .timeout = t_out, \ |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 365 | .sm = _sm, \ |
| 366 | } |
| 367 | |
| 368 | /* |
| 369 | * The board uses 4 i2c controllers, initialize all of |
| 370 | * them with slave data setup time of 250 ns, |
Linus Walleij | 2b030bd | 2011-05-13 12:31:13 +0200 | [diff] [blame] | 371 | * Tx & Rx FIFO threshold values as 8 and standard |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 372 | * mode of operation |
| 373 | */ |
Linus Walleij | 2b030bd | 2011-05-13 12:31:13 +0200 | [diff] [blame] | 374 | U8500_I2C_CONTROLLER(0, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); |
| 375 | U8500_I2C_CONTROLLER(1, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); |
| 376 | U8500_I2C_CONTROLLER(2, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); |
| 377 | U8500_I2C_CONTROLLER(3, 0xe, 1, 8, 100000, 200, I2C_FREQ_MODE_FAST); |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 378 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 379 | static void __init mop500_i2c_init(struct device *parent) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 380 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 381 | db8500_add_i2c0(parent, &u8500_i2c0_data); |
| 382 | db8500_add_i2c1(parent, &u8500_i2c1_data); |
| 383 | db8500_add_i2c2(parent, &u8500_i2c2_data); |
| 384 | db8500_add_i2c3(parent, &u8500_i2c3_data); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 385 | } |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 386 | |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 387 | static struct gpio_keys_button mop500_gpio_keys[] = { |
| 388 | { |
| 389 | .desc = "SFH7741 Proximity Sensor", |
| 390 | .type = EV_SW, |
| 391 | .code = SW_FRONT_PROXIMITY, |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 392 | .active_low = 0, |
| 393 | .can_disable = 1, |
| 394 | } |
| 395 | }; |
| 396 | |
| 397 | static struct regulator *prox_regulator; |
| 398 | static int mop500_prox_activate(struct device *dev); |
| 399 | static void mop500_prox_deactivate(struct device *dev); |
| 400 | |
| 401 | static struct gpio_keys_platform_data mop500_gpio_keys_data = { |
| 402 | .buttons = mop500_gpio_keys, |
| 403 | .nbuttons = ARRAY_SIZE(mop500_gpio_keys), |
| 404 | .enable = mop500_prox_activate, |
| 405 | .disable = mop500_prox_deactivate, |
| 406 | }; |
| 407 | |
| 408 | static struct platform_device mop500_gpio_keys_device = { |
| 409 | .name = "gpio-keys", |
| 410 | .id = 0, |
| 411 | .dev = { |
| 412 | .platform_data = &mop500_gpio_keys_data, |
| 413 | }, |
| 414 | }; |
| 415 | |
| 416 | static int mop500_prox_activate(struct device *dev) |
| 417 | { |
| 418 | prox_regulator = regulator_get(&mop500_gpio_keys_device.dev, |
| 419 | "vcc"); |
| 420 | if (IS_ERR(prox_regulator)) { |
| 421 | dev_err(&mop500_gpio_keys_device.dev, |
| 422 | "no regulator\n"); |
| 423 | return PTR_ERR(prox_regulator); |
| 424 | } |
| 425 | regulator_enable(prox_regulator); |
| 426 | return 0; |
| 427 | } |
| 428 | |
| 429 | static void mop500_prox_deactivate(struct device *dev) |
| 430 | { |
| 431 | regulator_disable(prox_regulator); |
| 432 | regulator_put(prox_regulator); |
| 433 | } |
| 434 | |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 435 | static struct cryp_platform_data u8500_cryp1_platform_data = { |
| 436 | .mem_to_engine = { |
| 437 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 438 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 439 | .dst_dev_type = DB8500_DMA_DEV48_CAC1_TX, |
| 440 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 441 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 442 | .mode = STEDMA40_MODE_LOGICAL, |
| 443 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
| 444 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
| 445 | }, |
| 446 | .engine_to_mem = { |
| 447 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 448 | .src_dev_type = DB8500_DMA_DEV48_CAC1_RX, |
| 449 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 450 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 451 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 452 | .mode = STEDMA40_MODE_LOGICAL, |
| 453 | .src_info.psize = STEDMA40_PSIZE_LOG_4, |
| 454 | .dst_info.psize = STEDMA40_PSIZE_LOG_4, |
| 455 | } |
| 456 | }; |
| 457 | |
| 458 | static struct stedma40_chan_cfg u8500_hash_dma_cfg_tx = { |
| 459 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 460 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 461 | .dst_dev_type = DB8500_DMA_DEV50_HAC1_TX, |
| 462 | .src_info.data_width = STEDMA40_WORD_WIDTH, |
| 463 | .dst_info.data_width = STEDMA40_WORD_WIDTH, |
| 464 | .mode = STEDMA40_MODE_LOGICAL, |
| 465 | .src_info.psize = STEDMA40_PSIZE_LOG_16, |
| 466 | .dst_info.psize = STEDMA40_PSIZE_LOG_16, |
| 467 | }; |
| 468 | |
| 469 | static struct hash_platform_data u8500_hash1_platform_data = { |
| 470 | .mem_to_engine = &u8500_hash_dma_cfg_tx, |
| 471 | .dma_filter = stedma40_filter, |
| 472 | }; |
| 473 | |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 474 | /* add any platform devices here - TODO */ |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 475 | static struct platform_device *mop500_platform_devs[] __initdata = { |
Philippe Langlais | a71b819 | 2011-01-14 10:53:59 +0100 | [diff] [blame] | 476 | &mop500_gpio_keys_device, |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 477 | &ab8500_device, |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 478 | }; |
| 479 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 480 | #ifdef CONFIG_STE_DMA40 |
| 481 | static struct stedma40_chan_cfg ssp0_dma_cfg_rx = { |
| 482 | .mode = STEDMA40_MODE_LOGICAL, |
| 483 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 484 | .src_dev_type = DB8500_DMA_DEV8_SSP0_RX, |
| 485 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 486 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 487 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 488 | }; |
| 489 | |
| 490 | static struct stedma40_chan_cfg ssp0_dma_cfg_tx = { |
| 491 | .mode = STEDMA40_MODE_LOGICAL, |
| 492 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 493 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 494 | .dst_dev_type = DB8500_DMA_DEV8_SSP0_TX, |
| 495 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 496 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 497 | }; |
| 498 | #endif |
| 499 | |
Lee Jones | 15daf69 | 2012-03-15 16:47:11 +0000 | [diff] [blame] | 500 | static struct pl022_ssp_controller ssp0_plat = { |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 501 | .bus_id = 0, |
| 502 | #ifdef CONFIG_STE_DMA40 |
| 503 | .enable_dma = 1, |
| 504 | .dma_filter = stedma40_filter, |
| 505 | .dma_rx_param = &ssp0_dma_cfg_rx, |
| 506 | .dma_tx_param = &ssp0_dma_cfg_tx, |
| 507 | #else |
| 508 | .enable_dma = 0, |
| 509 | #endif |
| 510 | /* on this platform, gpio 31,142,144,214 & |
| 511 | * 224 are connected as chip selects |
| 512 | */ |
| 513 | .num_chipselect = 5, |
| 514 | }; |
| 515 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 516 | static void __init mop500_spi_init(struct device *parent) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 517 | { |
Lee Jones | 15daf69 | 2012-03-15 16:47:11 +0000 | [diff] [blame] | 518 | db8500_add_ssp0(parent, &ssp0_plat); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 519 | } |
| 520 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 521 | #ifdef CONFIG_STE_DMA40 |
| 522 | static struct stedma40_chan_cfg uart0_dma_cfg_rx = { |
| 523 | .mode = STEDMA40_MODE_LOGICAL, |
| 524 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 525 | .src_dev_type = DB8500_DMA_DEV13_UART0_RX, |
| 526 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 527 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 528 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 529 | }; |
| 530 | |
| 531 | static struct stedma40_chan_cfg uart0_dma_cfg_tx = { |
| 532 | .mode = STEDMA40_MODE_LOGICAL, |
| 533 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 534 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 535 | .dst_dev_type = DB8500_DMA_DEV13_UART0_TX, |
| 536 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 537 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 538 | }; |
| 539 | |
| 540 | static struct stedma40_chan_cfg uart1_dma_cfg_rx = { |
| 541 | .mode = STEDMA40_MODE_LOGICAL, |
| 542 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 543 | .src_dev_type = DB8500_DMA_DEV12_UART1_RX, |
| 544 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 545 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 546 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 547 | }; |
| 548 | |
| 549 | static struct stedma40_chan_cfg uart1_dma_cfg_tx = { |
| 550 | .mode = STEDMA40_MODE_LOGICAL, |
| 551 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 552 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 553 | .dst_dev_type = DB8500_DMA_DEV12_UART1_TX, |
| 554 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 555 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 556 | }; |
| 557 | |
| 558 | static struct stedma40_chan_cfg uart2_dma_cfg_rx = { |
| 559 | .mode = STEDMA40_MODE_LOGICAL, |
| 560 | .dir = STEDMA40_PERIPH_TO_MEM, |
| 561 | .src_dev_type = DB8500_DMA_DEV11_UART2_RX, |
| 562 | .dst_dev_type = STEDMA40_DEV_DST_MEMORY, |
| 563 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 564 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 565 | }; |
| 566 | |
| 567 | static struct stedma40_chan_cfg uart2_dma_cfg_tx = { |
| 568 | .mode = STEDMA40_MODE_LOGICAL, |
| 569 | .dir = STEDMA40_MEM_TO_PERIPH, |
| 570 | .src_dev_type = STEDMA40_DEV_SRC_MEMORY, |
| 571 | .dst_dev_type = DB8500_DMA_DEV11_UART2_TX, |
| 572 | .src_info.data_width = STEDMA40_BYTE_WIDTH, |
| 573 | .dst_info.data_width = STEDMA40_BYTE_WIDTH, |
| 574 | }; |
| 575 | #endif |
| 576 | |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 577 | #define PRCC_K_SOFTRST_SET 0x18 |
| 578 | #define PRCC_K_SOFTRST_CLEAR 0x1C |
| 579 | static void ux500_uart0_reset(void) |
| 580 | { |
| 581 | void __iomem *prcc_rst_set, *prcc_rst_clr; |
| 582 | |
| 583 | prcc_rst_set = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE + |
| 584 | PRCC_K_SOFTRST_SET); |
| 585 | prcc_rst_clr = (void __iomem *)IO_ADDRESS(U8500_CLKRST1_BASE + |
| 586 | PRCC_K_SOFTRST_CLEAR); |
| 587 | |
| 588 | /* Activate soft reset PRCC_K_SOFTRST_CLEAR */ |
| 589 | writel((readl(prcc_rst_clr) | 0x1), prcc_rst_clr); |
| 590 | udelay(1); |
| 591 | |
| 592 | /* Release soft reset PRCC_K_SOFTRST_SET */ |
| 593 | writel((readl(prcc_rst_set) | 0x1), prcc_rst_set); |
| 594 | udelay(1); |
| 595 | } |
| 596 | |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 597 | /* This needs to be referenced by callbacks */ |
| 598 | struct pinctrl *u0_p; |
| 599 | struct pinctrl_state *u0_def; |
| 600 | struct pinctrl_state *u0_sleep; |
| 601 | |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 602 | static void ux500_uart0_init(void) |
| 603 | { |
| 604 | int ret; |
| 605 | |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 606 | if (IS_ERR(u0_p) || IS_ERR(u0_def)) |
| 607 | return; |
| 608 | |
| 609 | ret = pinctrl_select_state(u0_p, u0_def); |
| 610 | if (ret) |
| 611 | pr_err("could not set UART0 defstate\n"); |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 612 | } |
| 613 | |
| 614 | static void ux500_uart0_exit(void) |
| 615 | { |
| 616 | int ret; |
| 617 | |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 618 | if (IS_ERR(u0_p) || IS_ERR(u0_sleep)) |
| 619 | return; |
| 620 | |
| 621 | ret = pinctrl_select_state(u0_p, u0_sleep); |
| 622 | if (ret) |
| 623 | pr_err("could not set UART0 idlestate\n"); |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 624 | } |
| 625 | |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 626 | static struct amba_pl011_data uart0_plat = { |
| 627 | #ifdef CONFIG_STE_DMA40 |
| 628 | .dma_filter = stedma40_filter, |
| 629 | .dma_rx_param = &uart0_dma_cfg_rx, |
| 630 | .dma_tx_param = &uart0_dma_cfg_tx, |
| 631 | #endif |
Shreshtha Kumar Sahu | 1a7d436 | 2011-06-13 10:11:44 +0200 | [diff] [blame] | 632 | .init = ux500_uart0_init, |
| 633 | .exit = ux500_uart0_exit, |
| 634 | .reset = ux500_uart0_reset, |
Linus Walleij | 5d7b846 | 2010-10-14 13:57:59 +0200 | [diff] [blame] | 635 | }; |
| 636 | |
| 637 | static struct amba_pl011_data uart1_plat = { |
| 638 | #ifdef CONFIG_STE_DMA40 |
| 639 | .dma_filter = stedma40_filter, |
| 640 | .dma_rx_param = &uart1_dma_cfg_rx, |
| 641 | .dma_tx_param = &uart1_dma_cfg_tx, |
| 642 | #endif |
| 643 | }; |
| 644 | |
| 645 | static struct amba_pl011_data uart2_plat = { |
| 646 | #ifdef CONFIG_STE_DMA40 |
| 647 | .dma_filter = stedma40_filter, |
| 648 | .dma_rx_param = &uart2_dma_cfg_rx, |
| 649 | .dma_tx_param = &uart2_dma_cfg_tx, |
| 650 | #endif |
| 651 | }; |
| 652 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 653 | static void __init mop500_uart_init(struct device *parent) |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 654 | { |
Linus Walleij | a098066 | 2012-05-07 01:33:24 +0200 | [diff] [blame] | 655 | struct amba_device *uart0_device; |
| 656 | |
| 657 | uart0_device = db8500_add_uart0(parent, &uart0_plat); |
| 658 | if (uart0_device) { |
| 659 | u0_p = pinctrl_get(&uart0_device->dev); |
| 660 | if (IS_ERR(u0_p)) |
| 661 | dev_err(&uart0_device->dev, |
| 662 | "could not get UART0 pinctrl\n"); |
| 663 | else { |
| 664 | u0_def = pinctrl_lookup_state(u0_p, |
| 665 | PINCTRL_STATE_DEFAULT); |
| 666 | if (IS_ERR(u0_def)) { |
| 667 | dev_err(&uart0_device->dev, |
| 668 | "could not get UART0 defstate\n"); |
| 669 | } |
| 670 | u0_sleep = pinctrl_lookup_state(u0_p, |
| 671 | PINCTRL_STATE_SLEEP); |
| 672 | if (IS_ERR(u0_sleep)) |
| 673 | dev_err(&uart0_device->dev, |
| 674 | "could not get UART0 idlestate\n"); |
| 675 | } |
| 676 | } |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 677 | db8500_add_uart1(parent, &uart1_plat); |
| 678 | db8500_add_uart2(parent, &uart2_plat); |
Rabin Vincent | fbf1ead | 2010-09-29 19:46:32 +0530 | [diff] [blame] | 679 | } |
| 680 | |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 681 | static void __init u8500_cryp1_hash1_init(struct device *parent) |
| 682 | { |
| 683 | db8500_add_cryp1(parent, &u8500_cryp1_platform_data); |
| 684 | db8500_add_hash1(parent, &u8500_hash1_platform_data); |
| 685 | } |
| 686 | |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 687 | static struct platform_device *snowball_platform_devs[] __initdata = { |
| 688 | &snowball_led_dev, |
| 689 | &snowball_key_dev, |
Lee Jones | e6fada5 | 2012-05-17 13:18:36 +0100 | [diff] [blame] | 690 | &snowball_sbnet_dev, |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 691 | &ab8500_device, |
| 692 | }; |
| 693 | |
Lee Jones | 11a0b5f0 | 2012-05-30 09:55:38 +0800 | [diff] [blame] | 694 | static struct platform_device *snowball_of_platform_devs[] __initdata = { |
| 695 | &snowball_led_dev, |
| 696 | &snowball_key_dev, |
Lee Jones | 11a0b5f0 | 2012-05-30 09:55:38 +0800 | [diff] [blame] | 697 | }; |
| 698 | |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 699 | static void __init mop500_init_machine(void) |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 700 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 701 | struct device *parent = NULL; |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 702 | int i2c0_devs; |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 703 | int i; |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 704 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 705 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 706 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 707 | mop500_pinmaps_init(); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 708 | parent = u8500_init_devices(); |
Rabin Vincent | ea05a57 | 2010-06-03 07:58:42 +0100 | [diff] [blame] | 709 | |
Lee Jones | 7e0ce27 | 2012-03-15 16:46:17 +0000 | [diff] [blame] | 710 | /* FIXME: parent of ab8500 should be prcmu */ |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 711 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) |
| 712 | mop500_platform_devs[i]->dev.parent = parent; |
| 713 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 714 | platform_add_devices(mop500_platform_devs, |
| 715 | ARRAY_SIZE(mop500_platform_devs)); |
Srinidhi Kasagar | d48a41c | 2010-02-03 13:02:48 +0100 | [diff] [blame] | 716 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 717 | mop500_i2c_init(parent); |
| 718 | mop500_sdi_init(parent); |
| 719 | mop500_spi_init(parent); |
Ola Lilja | c0af14d | 2012-04-20 11:32:59 +0200 | [diff] [blame] | 720 | mop500_msp_init(parent); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 721 | mop500_uart_init(parent); |
Hanumath Prasad | 008f8a2 | 2010-08-19 12:06:32 +0100 | [diff] [blame] | 722 | |
Andreas Westin | 585d188 | 2012-05-10 10:14:06 +0200 | [diff] [blame] | 723 | u8500_cryp1_hash1_init(parent); |
| 724 | |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 725 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 726 | |
| 727 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
| 728 | i2c_register_board_info(2, mop500_i2c2_devices, |
| 729 | ARRAY_SIZE(mop500_i2c2_devices)); |
| 730 | |
| 731 | /* This board has full regulator constraints */ |
| 732 | regulator_has_full_constraints(); |
Lee Jones | fd6948b | 2012-05-02 09:53:48 +0100 | [diff] [blame] | 733 | |
| 734 | mop500_uib_init(); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 735 | } |
| 736 | |
| 737 | static void __init snowball_init_machine(void) |
| 738 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 739 | struct device *parent = NULL; |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 740 | int i; |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 741 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 742 | snowball_pinmaps_init(); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 743 | parent = u8500_init_devices(); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 744 | |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 745 | for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++) |
| 746 | snowball_platform_devs[i]->dev.parent = parent; |
| 747 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 748 | platform_add_devices(snowball_platform_devs, |
| 749 | ARRAY_SIZE(snowball_platform_devs)); |
| 750 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 751 | mop500_i2c_init(parent); |
| 752 | snowball_sdi_init(parent); |
| 753 | mop500_spi_init(parent); |
Ola Lilja | c0af14d | 2012-04-20 11:32:59 +0200 | [diff] [blame] | 754 | mop500_msp_init(parent); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 755 | mop500_uart_init(parent); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 756 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 757 | /* This board has full regulator constraints */ |
| 758 | regulator_has_full_constraints(); |
| 759 | } |
| 760 | |
| 761 | static void __init hrefv60_init_machine(void) |
| 762 | { |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 763 | struct device *parent = NULL; |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 764 | int i2c0_devs; |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 765 | int i; |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 766 | |
| 767 | /* |
| 768 | * The HREFv60 board removed a GPIO expander and routed |
| 769 | * all these GPIO pins to the internal GPIO controller |
| 770 | * instead. |
| 771 | */ |
| 772 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
| 773 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 774 | hrefv60_pinmaps_init(); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 775 | parent = u8500_init_devices(); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 776 | |
Lee Jones | b024a0c | 2012-02-06 11:22:25 -0800 | [diff] [blame] | 777 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) |
| 778 | mop500_platform_devs[i]->dev.parent = parent; |
| 779 | |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 780 | platform_add_devices(mop500_platform_devs, |
| 781 | ARRAY_SIZE(mop500_platform_devs)); |
| 782 | |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 783 | mop500_i2c_init(parent); |
| 784 | hrefv60_sdi_init(parent); |
| 785 | mop500_spi_init(parent); |
Ola Lilja | c0af14d | 2012-04-20 11:32:59 +0200 | [diff] [blame] | 786 | mop500_msp_init(parent); |
Lee Jones | 1840342 | 2012-02-06 11:22:21 -0800 | [diff] [blame] | 787 | mop500_uart_init(parent); |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 788 | |
| 789 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
| 790 | |
| 791 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; |
Linus Walleij | cf568c5 | 2011-03-30 14:31:42 +0200 | [diff] [blame] | 792 | |
| 793 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
Philippe Langlais | dd7b2a0 | 2011-01-12 11:26:20 +0100 | [diff] [blame] | 794 | i2c_register_board_info(2, mop500_i2c2_devices, |
| 795 | ARRAY_SIZE(mop500_i2c2_devices)); |
Linus Walleij | db24520 | 2011-04-04 10:44:51 +0200 | [diff] [blame] | 796 | |
| 797 | /* This board has full regulator constraints */ |
| 798 | regulator_has_full_constraints(); |
Lee Jones | fd6948b | 2012-05-02 09:53:48 +0100 | [diff] [blame] | 799 | |
| 800 | mop500_uib_init(); |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 801 | } |
| 802 | |
| 803 | MACHINE_START(U8500, "ST-Ericsson MOP500 platform") |
| 804 | /* Maintainer: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> */ |
Nicolas Pitre | bc77b1a | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 805 | .atag_offset = 0x100, |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 806 | .map_io = u8500_map_io, |
Rabin Vincent | 178980f | 2010-05-03 07:39:02 +0100 | [diff] [blame] | 807 | .init_irq = ux500_init_irq, |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 808 | /* we re-use nomadik timer here */ |
Rabin Vincent | 41ac329 | 2010-05-03 08:28:05 +0100 | [diff] [blame] | 809 | .timer = &ux500_timer, |
Marc Zyngier | bbf5f38 | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 810 | .handle_irq = gic_handle_irq, |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 811 | .init_machine = mop500_init_machine, |
Shawn Guo | a010bc2 | 2012-05-02 17:10:07 +0800 | [diff] [blame] | 812 | .init_late = ux500_init_late, |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 813 | MACHINE_END |
| 814 | |
| 815 | MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+") |
Nicolas Pitre | bc77b1a | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 816 | .atag_offset = 0x100, |
Linus Walleij | 4b4f757 | 2011-02-15 15:01:35 +0100 | [diff] [blame] | 817 | .map_io = u8500_map_io, |
| 818 | .init_irq = ux500_init_irq, |
| 819 | .timer = &ux500_timer, |
Marc Zyngier | bbf5f38 | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 820 | .handle_irq = gic_handle_irq, |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 821 | .init_machine = hrefv60_init_machine, |
Shawn Guo | a010bc2 | 2012-05-02 17:10:07 +0800 | [diff] [blame] | 822 | .init_late = ux500_init_late, |
Srinidhi Kasagar | aa44ef4 | 2009-11-28 08:17:18 +0100 | [diff] [blame] | 823 | MACHINE_END |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 824 | |
| 825 | MACHINE_START(SNOWBALL, "Calao Systems Snowball platform") |
Nicolas Pitre | bc77b1a | 2011-07-05 22:38:18 -0400 | [diff] [blame] | 826 | .atag_offset = 0x100, |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 827 | .map_io = u8500_map_io, |
| 828 | .init_irq = ux500_init_irq, |
| 829 | /* we re-use nomadik timer here */ |
| 830 | .timer = &ux500_timer, |
Marc Zyngier | bbf5f38 | 2011-09-06 10:23:45 +0100 | [diff] [blame] | 831 | .handle_irq = gic_handle_irq, |
Lee Jones | 110c2c2 | 2011-08-26 16:54:07 +0100 | [diff] [blame] | 832 | .init_machine = snowball_init_machine, |
Shawn Guo | a010bc2 | 2012-05-02 17:10:07 +0800 | [diff] [blame] | 833 | .init_late = ux500_init_late, |
Robert Marklund | 350abe0 | 2011-06-20 15:55:46 +0200 | [diff] [blame] | 834 | MACHINE_END |
Arnd Bergmann | 2d33429 | 2012-03-07 15:04:07 +0000 | [diff] [blame] | 835 | |
| 836 | #ifdef CONFIG_MACH_UX500_DT |
Lee Jones | 7e0ce27 | 2012-03-15 16:46:17 +0000 | [diff] [blame] | 837 | |
| 838 | struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = { |
Lee Jones | 513c27f | 2012-04-13 15:05:05 +0100 | [diff] [blame] | 839 | /* Requires DMA and call-back bindings. */ |
Lee Jones | 4905af0 | 2012-03-07 17:35:04 +0000 | [diff] [blame] | 840 | OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat), |
| 841 | OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat), |
| 842 | OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat), |
Lee Jones | 513c27f | 2012-04-13 15:05:05 +0100 | [diff] [blame] | 843 | /* Requires DMA bindings. */ |
Lee Jones | 15daf69 | 2012-03-15 16:47:11 +0000 | [diff] [blame] | 844 | OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0", &ssp0_plat), |
Lee Jones | 513c27f | 2012-04-13 15:05:05 +0100 | [diff] [blame] | 845 | /* Requires clock name bindings. */ |
| 846 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e000, "gpio.0", NULL), |
| 847 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8012e080, "gpio.1", NULL), |
| 848 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e000, "gpio.2", NULL), |
| 849 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e080, "gpio.3", NULL), |
| 850 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e100, "gpio.4", NULL), |
| 851 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8000e180, "gpio.5", NULL), |
| 852 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e000, "gpio.6", NULL), |
| 853 | OF_DEV_AUXDATA("st,nomadik-gpio", 0x8011e080, "gpio.7", NULL), |
| 854 | OF_DEV_AUXDATA("st,nomadik-gpio", 0xa03fe000, "gpio.8", NULL), |
Lee Jones | 7e0ce27 | 2012-03-15 16:46:17 +0000 | [diff] [blame] | 855 | {}, |
| 856 | }; |
| 857 | |
Lee Jones | 2cfaa62 | 2012-04-19 21:36:30 +0100 | [diff] [blame] | 858 | static const struct of_device_id u8500_local_bus_nodes[] = { |
Lee Jones | 7e0ce27 | 2012-03-15 16:46:17 +0000 | [diff] [blame] | 859 | /* only create devices below soc node */ |
| 860 | { .compatible = "stericsson,db8500", }, |
Lee Jones | 48a4ea6 | 2012-05-29 15:06:55 +0800 | [diff] [blame] | 861 | { .compatible = "stericsson,db8500-prcmu", }, |
Lee Jones | 890d84f | 2012-05-04 14:01:00 +0100 | [diff] [blame] | 862 | { .compatible = "stericsson,db8500-prcmu-regulator", }, |
Lee Jones | 48a4ea6 | 2012-05-29 15:06:55 +0800 | [diff] [blame] | 863 | { .compatible = "stericsson,ab8500", }, |
| 864 | { .compatible = "stericsson,ab8500-regulator", }, |
Lee Jones | 2cfaa62 | 2012-04-19 21:36:30 +0100 | [diff] [blame] | 865 | { .compatible = "simple-bus"}, |
Lee Jones | 7e0ce27 | 2012-03-15 16:46:17 +0000 | [diff] [blame] | 866 | { }, |
| 867 | }; |
| 868 | |
Arnd Bergmann | 2d33429 | 2012-03-07 15:04:07 +0000 | [diff] [blame] | 869 | static void __init u8500_init_machine(void) |
| 870 | { |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 871 | struct device *parent = NULL; |
| 872 | int i2c0_devs; |
| 873 | int i; |
| 874 | |
Linus Walleij | ed781d39 | 2012-05-03 00:44:52 +0200 | [diff] [blame] | 875 | /* Pinmaps must be in place before devices register */ |
| 876 | if (of_machine_is_compatible("st-ericsson,mop500")) |
| 877 | mop500_pinmaps_init(); |
| 878 | else if (of_machine_is_compatible("calaosystems,snowball-a9500")) |
| 879 | snowball_pinmaps_init(); |
| 880 | else if (of_machine_is_compatible("st-ericsson,hrefv60+")) |
| 881 | hrefv60_pinmaps_init(); |
| 882 | |
Lee Jones | f65c198 | 2012-05-29 10:03:09 +0800 | [diff] [blame] | 883 | parent = u8500_of_init_devices(); |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 884 | |
| 885 | for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++) |
| 886 | mop500_platform_devs[i]->dev.parent = parent; |
| 887 | for (i = 0; i < ARRAY_SIZE(snowball_platform_devs); i++) |
| 888 | snowball_platform_devs[i]->dev.parent = parent; |
| 889 | |
Lee Jones | 7e0ce27 | 2012-03-15 16:46:17 +0000 | [diff] [blame] | 890 | /* automatically probe child nodes of db8500 device */ |
Lee Jones | 2cfaa62 | 2012-04-19 21:36:30 +0100 | [diff] [blame] | 891 | of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent); |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 892 | |
| 893 | if (of_machine_is_compatible("st-ericsson,mop500")) { |
| 894 | mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR; |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 895 | |
| 896 | platform_add_devices(mop500_platform_devs, |
| 897 | ARRAY_SIZE(mop500_platform_devs)); |
| 898 | |
| 899 | mop500_sdi_init(parent); |
Lee Jones | 4809f90 | 2012-04-19 21:36:40 +0100 | [diff] [blame] | 900 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
| 901 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
| 902 | i2c_register_board_info(2, mop500_i2c2_devices, |
| 903 | ARRAY_SIZE(mop500_i2c2_devices)); |
| 904 | |
Lee Jones | fd6948b | 2012-05-02 09:53:48 +0100 | [diff] [blame] | 905 | mop500_uib_init(); |
| 906 | |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 907 | } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) { |
Lee Jones | 11a0b5f0 | 2012-05-30 09:55:38 +0800 | [diff] [blame] | 908 | /* |
| 909 | * Devices to be DT:ed: |
| 910 | * snowball_led_dev = todo |
| 911 | * snowball_key_dev = todo |
Lee Jones | ada46cd | 2012-05-29 10:28:34 +0800 | [diff] [blame] | 912 | * snowball_sbnet_dev = done |
Lee Jones | 48a4ea6 | 2012-05-29 15:06:55 +0800 | [diff] [blame] | 913 | * ab8500_device = done |
Lee Jones | 11a0b5f0 | 2012-05-30 09:55:38 +0800 | [diff] [blame] | 914 | */ |
| 915 | platform_add_devices(snowball_of_platform_devs, |
| 916 | ARRAY_SIZE(snowball_of_platform_devs)); |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 917 | |
| 918 | snowball_sdi_init(parent); |
| 919 | } else if (of_machine_is_compatible("st-ericsson,hrefv60+")) { |
| 920 | /* |
| 921 | * The HREFv60 board removed a GPIO expander and routed |
| 922 | * all these GPIO pins to the internal GPIO controller |
| 923 | * instead. |
| 924 | */ |
| 925 | mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO; |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 926 | platform_add_devices(mop500_platform_devs, |
| 927 | ARRAY_SIZE(mop500_platform_devs)); |
| 928 | |
| 929 | hrefv60_sdi_init(parent); |
Lee Jones | 4809f90 | 2012-04-19 21:36:40 +0100 | [diff] [blame] | 930 | |
| 931 | i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices); |
| 932 | i2c0_devs -= NUM_PRE_V60_I2C0_DEVICES; |
| 933 | |
| 934 | i2c_register_board_info(0, mop500_i2c0_devices, i2c0_devs); |
| 935 | i2c_register_board_info(2, mop500_i2c2_devices, |
| 936 | ARRAY_SIZE(mop500_i2c2_devices)); |
Lee Jones | fd6948b | 2012-05-02 09:53:48 +0100 | [diff] [blame] | 937 | |
| 938 | mop500_uib_init(); |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 939 | } |
| 940 | mop500_i2c_init(parent); |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 941 | |
Arnd Bergmann | 7734fed | 2012-03-02 22:25:02 +0000 | [diff] [blame] | 942 | /* This board has full regulator constraints */ |
| 943 | regulator_has_full_constraints(); |
Arnd Bergmann | 2d33429 | 2012-03-07 15:04:07 +0000 | [diff] [blame] | 944 | } |
| 945 | |
| 946 | static const char * u8500_dt_board_compat[] = { |
| 947 | "calaosystems,snowball-a9500", |
| 948 | "st-ericsson,hrefv60+", |
| 949 | "st-ericsson,u8500", |
| 950 | "st-ericsson,mop500", |
| 951 | NULL, |
| 952 | }; |
| 953 | |
| 954 | |
| 955 | DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)") |
| 956 | .map_io = u8500_map_io, |
| 957 | .init_irq = ux500_init_irq, |
| 958 | /* we re-use nomadik timer here */ |
| 959 | .timer = &ux500_timer, |
| 960 | .handle_irq = gic_handle_irq, |
| 961 | .init_machine = u8500_init_machine, |
Shawn Guo | a010bc2 | 2012-05-02 17:10:07 +0800 | [diff] [blame] | 962 | .init_late = ux500_init_late, |
Arnd Bergmann | 2d33429 | 2012-03-07 15:04:07 +0000 | [diff] [blame] | 963 | .dt_compat = u8500_dt_board_compat, |
| 964 | MACHINE_END |
| 965 | #endif |