blob: cac6b32b279649472111548cd5517676127f004b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +01002/*
3 * Copyright (C) 2009
4 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
5 *
Stefano Babic7faee912011-08-21 10:45:44 +02006 * Copyright (C) 2011
7 * Stefano Babic, DENX Software Engineering, <sbabic@denx.de>
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +01008 */
Simon Glass2772b4d2014-10-01 19:57:26 -06009#include <errno.h>
10#include <dm.h>
11#include <malloc.h>
Stefano Babicd77fe992010-07-06 17:05:06 +020012#include <asm/arch/imx-regs.h>
Stefano Babic7faee912011-08-21 10:45:44 +020013#include <asm/gpio.h>
Stefano Babicd77fe992010-07-06 17:05:06 +020014#include <asm/io.h>
Walter Lozanoe58c4f52020-07-29 12:31:18 -030015#include <dt-structs.h>
16#include <mapmem.h>
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010017
Stefano Babic7faee912011-08-21 10:45:44 +020018enum mxc_gpio_direction {
19 MXC_GPIO_DIRECTION_IN,
20 MXC_GPIO_DIRECTION_OUT,
21};
22
Simon Glass2772b4d2014-10-01 19:57:26 -060023#define GPIO_PER_BANK 32
24
25struct mxc_gpio_plat {
Walter Lozanoe58c4f52020-07-29 12:31:18 -030026#if CONFIG_IS_ENABLED(OF_PLATDATA)
27 /* Put this first since driver model will copy the data here */
28 struct dtd_gpio_mxc dtplat;
29#endif
Peng Fan86be4262015-02-10 14:46:33 +080030 int bank_index;
Simon Glass2772b4d2014-10-01 19:57:26 -060031 struct gpio_regs *regs;
32};
33
34struct mxc_bank_info {
Simon Glass2772b4d2014-10-01 19:57:26 -060035 struct gpio_regs *regs;
36};
37
Simon Glassfa4689a2019-12-06 21:41:35 -070038#if !CONFIG_IS_ENABLED(DM_GPIO)
Lukasz Majewskic00b0932019-06-09 22:54:40 +020039#define GPIO_TO_PORT(n) ((n) / 32)
Stefano Babic7faee912011-08-21 10:45:44 +020040
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010041/* GPIO port description */
42static unsigned long gpio_ports[] = {
Stefano Babicd77fe992010-07-06 17:05:06 +020043 [0] = GPIO1_BASE_ADDR,
44 [1] = GPIO2_BASE_ADDR,
45 [2] = GPIO3_BASE_ADDR,
Tom Rini31df83b2022-11-19 18:45:27 -050046#if defined(CONFIG_MX51) || \
Adrian Alonso840d2e32015-08-11 11:19:51 -050047 defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
Peng Fan39945c12018-11-20 10:19:25 +000048 defined(CONFIG_MX7) || defined(CONFIG_IMX8M) || \
Giulio Benettia82cd872020-01-10 15:47:03 +010049 defined(CONFIG_ARCH_IMX8) || defined(CONFIG_IMXRT1050)
Stefano Babicd77fe992010-07-06 17:05:06 +020050 [3] = GPIO4_BASE_ADDR,
51#endif
Tom Rini31df83b2022-11-19 18:45:27 -050052#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
Peng Fan39945c12018-11-20 10:19:25 +000053 defined(CONFIG_MX7) || defined(CONFIG_IMX8M) || \
Giulio Benettia82cd872020-01-10 15:47:03 +010054 defined(CONFIG_ARCH_IMX8) || defined(CONFIG_IMXRT1050)
Liu Hui-R64343a71164c2011-01-03 22:27:38 +000055 [4] = GPIO5_BASE_ADDR,
Giulio Benettia82cd872020-01-10 15:47:03 +010056#if !(defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL) || \
57 defined(CONFIG_IMX8M) || defined(CONFIG_IMXRT1050))
Liu Hui-R64343a71164c2011-01-03 22:27:38 +000058 [5] = GPIO6_BASE_ADDR,
tremcf233ed2012-08-25 05:30:33 +000059#endif
Peng Fanf5dd87e2015-07-20 19:28:31 +080060#endif
Peng Fanb2242e12018-10-18 14:28:27 +020061#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_MX7) || \
62 defined(CONFIG_ARCH_IMX8)
Fabio Estevam1b691df2018-01-03 12:33:05 -020063#if !(defined(CONFIG_MX6UL) || defined(CONFIG_MX6ULL))
Liu Hui-R64343a71164c2011-01-03 22:27:38 +000064 [6] = GPIO7_BASE_ADDR,
65#endif
Peng Fanf5dd87e2015-07-20 19:28:31 +080066#endif
Peng Fanb2242e12018-10-18 14:28:27 +020067#if defined(CONFIG_ARCH_IMX8)
68 [7] = GPIO8_BASE_ADDR,
69#endif
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010070};
71
Stefano Babic7faee912011-08-21 10:45:44 +020072static int mxc_gpio_direction(unsigned int gpio,
73 enum mxc_gpio_direction direction)
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010074{
Vikram Narayananfbdf6bc2012-04-10 04:26:20 +000075 unsigned int port = GPIO_TO_PORT(gpio);
Stefano Babicd77fe992010-07-06 17:05:06 +020076 struct gpio_regs *regs;
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010077 u32 l;
78
79 if (port >= ARRAY_SIZE(gpio_ports))
Joe Hershbergerf8928f12011-11-11 15:55:36 -060080 return -1;
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010081
82 gpio &= 0x1f;
83
Stefano Babicd77fe992010-07-06 17:05:06 +020084 regs = (struct gpio_regs *)gpio_ports[port];
85
86 l = readl(&regs->gpio_dir);
87
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010088 switch (direction) {
Stefano Babicd77fe992010-07-06 17:05:06 +020089 case MXC_GPIO_DIRECTION_OUT:
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010090 l |= 1 << gpio;
91 break;
Stefano Babicd77fe992010-07-06 17:05:06 +020092 case MXC_GPIO_DIRECTION_IN:
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010093 l &= ~(1 << gpio);
94 }
Stefano Babicd77fe992010-07-06 17:05:06 +020095 writel(l, &regs->gpio_dir);
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +010096
97 return 0;
98}
99
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600100int gpio_set_value(unsigned gpio, int value)
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +0100101{
Vikram Narayananfbdf6bc2012-04-10 04:26:20 +0000102 unsigned int port = GPIO_TO_PORT(gpio);
Stefano Babicd77fe992010-07-06 17:05:06 +0200103 struct gpio_regs *regs;
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +0100104 u32 l;
105
106 if (port >= ARRAY_SIZE(gpio_ports))
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600107 return -1;
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +0100108
109 gpio &= 0x1f;
110
Stefano Babicd77fe992010-07-06 17:05:06 +0200111 regs = (struct gpio_regs *)gpio_ports[port];
112
113 l = readl(&regs->gpio_dr);
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +0100114 if (value)
115 l |= 1 << gpio;
116 else
117 l &= ~(1 << gpio);
Stefano Babicd77fe992010-07-06 17:05:06 +0200118 writel(l, &regs->gpio_dr);
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600119
120 return 0;
Guennadi Liakhovetski7c6a8562009-02-07 01:18:07 +0100121}
Stefano Babica44d2a52010-04-13 12:07:00 +0200122
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600123int gpio_get_value(unsigned gpio)
Stefano Babica44d2a52010-04-13 12:07:00 +0200124{
Vikram Narayananfbdf6bc2012-04-10 04:26:20 +0000125 unsigned int port = GPIO_TO_PORT(gpio);
Stefano Babicd77fe992010-07-06 17:05:06 +0200126 struct gpio_regs *regs;
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600127 u32 val;
Stefano Babica44d2a52010-04-13 12:07:00 +0200128
129 if (port >= ARRAY_SIZE(gpio_ports))
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600130 return -1;
Stefano Babica44d2a52010-04-13 12:07:00 +0200131
132 gpio &= 0x1f;
133
Stefano Babicd77fe992010-07-06 17:05:06 +0200134 regs = (struct gpio_regs *)gpio_ports[port];
135
Benoît Thébaudeaudaaf7a92012-08-20 10:55:41 +0000136 val = (readl(&regs->gpio_psr) >> gpio) & 0x01;
Stefano Babica44d2a52010-04-13 12:07:00 +0200137
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600138 return val;
Stefano Babica44d2a52010-04-13 12:07:00 +0200139}
Stefano Babic7faee912011-08-21 10:45:44 +0200140
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600141int gpio_request(unsigned gpio, const char *label)
Stefano Babic7faee912011-08-21 10:45:44 +0200142{
Vikram Narayananfbdf6bc2012-04-10 04:26:20 +0000143 unsigned int port = GPIO_TO_PORT(gpio);
Stefano Babic7faee912011-08-21 10:45:44 +0200144 if (port >= ARRAY_SIZE(gpio_ports))
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600145 return -1;
Stefano Babic7faee912011-08-21 10:45:44 +0200146 return 0;
147}
148
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600149int gpio_free(unsigned gpio)
Stefano Babic7faee912011-08-21 10:45:44 +0200150{
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600151 return 0;
Stefano Babic7faee912011-08-21 10:45:44 +0200152}
153
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600154int gpio_direction_input(unsigned gpio)
Stefano Babic7faee912011-08-21 10:45:44 +0200155{
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600156 return mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_IN);
Stefano Babic7faee912011-08-21 10:45:44 +0200157}
158
Joe Hershbergerf8928f12011-11-11 15:55:36 -0600159int gpio_direction_output(unsigned gpio, int value)
Stefano Babic7faee912011-08-21 10:45:44 +0200160{
Dirk Behme1e0803f2013-07-15 15:58:27 +0200161 int ret = gpio_set_value(gpio, value);
Stefano Babic7faee912011-08-21 10:45:44 +0200162
163 if (ret < 0)
164 return ret;
165
Dirk Behme1e0803f2013-07-15 15:58:27 +0200166 return mxc_gpio_direction(gpio, MXC_GPIO_DIRECTION_OUT);
Stefano Babic7faee912011-08-21 10:45:44 +0200167}
Simon Glass2772b4d2014-10-01 19:57:26 -0600168#endif
169
Simon Glassfa4689a2019-12-06 21:41:35 -0700170#if CONFIG_IS_ENABLED(DM_GPIO)
Peng Fan0ed2cb12015-02-10 14:46:34 +0800171#include <fdtdec.h>
Simon Glass2772b4d2014-10-01 19:57:26 -0600172static int mxc_gpio_is_output(struct gpio_regs *regs, int offset)
173{
174 u32 val;
175
176 val = readl(&regs->gpio_dir);
177
178 return val & (1 << offset) ? 1 : 0;
179}
180
181static void mxc_gpio_bank_direction(struct gpio_regs *regs, int offset,
182 enum mxc_gpio_direction direction)
183{
184 u32 l;
185
186 l = readl(&regs->gpio_dir);
187
188 switch (direction) {
189 case MXC_GPIO_DIRECTION_OUT:
190 l |= 1 << offset;
191 break;
192 case MXC_GPIO_DIRECTION_IN:
193 l &= ~(1 << offset);
194 }
195 writel(l, &regs->gpio_dir);
196}
197
198static void mxc_gpio_bank_set_value(struct gpio_regs *regs, int offset,
199 int value)
200{
201 u32 l;
202
203 l = readl(&regs->gpio_dr);
204 if (value)
205 l |= 1 << offset;
206 else
207 l &= ~(1 << offset);
208 writel(l, &regs->gpio_dr);
209}
210
211static int mxc_gpio_bank_get_value(struct gpio_regs *regs, int offset)
212{
213 return (readl(&regs->gpio_psr) >> offset) & 0x01;
214}
215
Simon Glass2772b4d2014-10-01 19:57:26 -0600216/* set GPIO pin 'gpio' as an input */
217static int mxc_gpio_direction_input(struct udevice *dev, unsigned offset)
218{
219 struct mxc_bank_info *bank = dev_get_priv(dev);
Simon Glass2772b4d2014-10-01 19:57:26 -0600220
221 /* Configure GPIO direction as input. */
222 mxc_gpio_bank_direction(bank->regs, offset, MXC_GPIO_DIRECTION_IN);
223
224 return 0;
225}
226
227/* set GPIO pin 'gpio' as an output, with polarity 'value' */
228static int mxc_gpio_direction_output(struct udevice *dev, unsigned offset,
229 int value)
230{
231 struct mxc_bank_info *bank = dev_get_priv(dev);
Simon Glass2772b4d2014-10-01 19:57:26 -0600232
233 /* Configure GPIO output value. */
234 mxc_gpio_bank_set_value(bank->regs, offset, value);
235
236 /* Configure GPIO direction as output. */
237 mxc_gpio_bank_direction(bank->regs, offset, MXC_GPIO_DIRECTION_OUT);
238
239 return 0;
240}
241
242/* read GPIO IN value of pin 'gpio' */
243static int mxc_gpio_get_value(struct udevice *dev, unsigned offset)
244{
245 struct mxc_bank_info *bank = dev_get_priv(dev);
Simon Glass2772b4d2014-10-01 19:57:26 -0600246
247 return mxc_gpio_bank_get_value(bank->regs, offset);
248}
249
250/* write GPIO OUT value to pin 'gpio' */
251static int mxc_gpio_set_value(struct udevice *dev, unsigned offset,
252 int value)
253{
254 struct mxc_bank_info *bank = dev_get_priv(dev);
Simon Glass2772b4d2014-10-01 19:57:26 -0600255
256 mxc_gpio_bank_set_value(bank->regs, offset, value);
257
258 return 0;
259}
260
Simon Glass2772b4d2014-10-01 19:57:26 -0600261static int mxc_gpio_get_function(struct udevice *dev, unsigned offset)
262{
263 struct mxc_bank_info *bank = dev_get_priv(dev);
264
Simon Glass2772b4d2014-10-01 19:57:26 -0600265 /* GPIOF_FUNC is not implemented yet */
266 if (mxc_gpio_is_output(bank->regs, offset))
267 return GPIOF_OUTPUT;
268 else
269 return GPIOF_INPUT;
270}
271
272static const struct dm_gpio_ops gpio_mxc_ops = {
Simon Glass2772b4d2014-10-01 19:57:26 -0600273 .direction_input = mxc_gpio_direction_input,
274 .direction_output = mxc_gpio_direction_output,
275 .get_value = mxc_gpio_get_value,
276 .set_value = mxc_gpio_set_value,
277 .get_function = mxc_gpio_get_function,
Simon Glass2772b4d2014-10-01 19:57:26 -0600278};
279
Simon Glass2772b4d2014-10-01 19:57:26 -0600280static int mxc_gpio_probe(struct udevice *dev)
281{
282 struct mxc_bank_info *bank = dev_get_priv(dev);
Simon Glassfa20e932020-12-03 16:55:20 -0700283 struct mxc_gpio_plat *plat = dev_get_plat(dev);
Simon Glassde0977b2015-03-05 12:25:20 -0700284 struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
Simon Glass2772b4d2014-10-01 19:57:26 -0600285 int banknum;
286 char name[18], *str;
287
Walter Lozanoe58c4f52020-07-29 12:31:18 -0300288#if CONFIG_IS_ENABLED(OF_PLATDATA)
289 struct dtd_gpio_mxc *dtplat = &plat->dtplat;
290
291 plat->regs = map_sysmem(dtplat->reg[0], dtplat->reg[1]);
292#endif
293
Peng Fan86be4262015-02-10 14:46:33 +0800294 banknum = plat->bank_index;
Ye Li81a44212020-06-09 20:28:02 -0700295 if (IS_ENABLED(CONFIG_ARCH_IMX8))
296 sprintf(name, "GPIO%d_", banknum);
297 else
298 sprintf(name, "GPIO%d_", banknum + 1);
Simon Glass2772b4d2014-10-01 19:57:26 -0600299 str = strdup(name);
300 if (!str)
301 return -ENOMEM;
302 uc_priv->bank_name = str;
303 uc_priv->gpio_count = GPIO_PER_BANK;
304 bank->regs = plat->regs;
305
306 return 0;
307}
308
Simon Glassaad29ae2020-12-03 16:55:21 -0700309static int mxc_gpio_of_to_plat(struct udevice *dev)
Peng Fan0ed2cb12015-02-10 14:46:34 +0800310{
Simon Glassfa20e932020-12-03 16:55:20 -0700311 struct mxc_gpio_plat *plat = dev_get_plat(dev);
Walter Lozanoe58c4f52020-07-29 12:31:18 -0300312 if (!CONFIG_IS_ENABLED(OF_PLATDATA)) {
313 fdt_addr_t addr;
Tom Rini322ebe92020-08-04 11:11:02 -0400314 addr = dev_read_addr(dev);
Walter Lozanoe58c4f52020-07-29 12:31:18 -0300315 if (addr == FDT_ADDR_T_NONE)
316 return -EINVAL;
Peng Fan0ed2cb12015-02-10 14:46:34 +0800317
Walter Lozanoe58c4f52020-07-29 12:31:18 -0300318 plat->regs = (struct gpio_regs *)addr;
319 }
Simon Glassb4db3722020-12-16 21:20:24 -0700320 plat->bank_index = dev_seq(dev);
Ye Li755f3ee2020-06-09 20:29:51 -0700321
322 return 0;
323}
Peng Fan0ed2cb12015-02-10 14:46:34 +0800324
Ye Li755f3ee2020-06-09 20:29:51 -0700325static int mxc_gpio_bind(struct udevice *dev)
326{
Peng Fan0ed2cb12015-02-10 14:46:34 +0800327 return 0;
328}
329
330static const struct udevice_id mxc_gpio_ids[] = {
331 { .compatible = "fsl,imx35-gpio" },
332 { }
333};
334
Simon Glass2772b4d2014-10-01 19:57:26 -0600335U_BOOT_DRIVER(gpio_mxc) = {
336 .name = "gpio_mxc",
337 .id = UCLASS_GPIO,
338 .ops = &gpio_mxc_ops,
339 .probe = mxc_gpio_probe,
Simon Glassaad29ae2020-12-03 16:55:21 -0700340 .of_to_plat = mxc_gpio_of_to_plat,
Simon Glass71fa5b42020-12-03 16:55:18 -0700341 .plat_auto = sizeof(struct mxc_gpio_plat),
Simon Glass8a2b47f2020-12-03 16:55:17 -0700342 .priv_auto = sizeof(struct mxc_bank_info),
Peng Fan0ed2cb12015-02-10 14:46:34 +0800343 .of_match = mxc_gpio_ids,
344 .bind = mxc_gpio_bind,
345};
346
Simon Glassdf65db82020-12-28 20:34:57 -0700347DM_DRIVER_ALIAS(gpio_mxc, fsl_imx6q_gpio)
Walter Lozanoe58c4f52020-07-29 12:31:18 -0300348
Masahiro Yamada366b24f2015-08-12 07:31:55 +0900349#if !CONFIG_IS_ENABLED(OF_CONTROL)
Peng Fan0ed2cb12015-02-10 14:46:34 +0800350static const struct mxc_gpio_plat mxc_plat[] = {
351 { 0, (struct gpio_regs *)GPIO1_BASE_ADDR },
352 { 1, (struct gpio_regs *)GPIO2_BASE_ADDR },
353 { 2, (struct gpio_regs *)GPIO3_BASE_ADDR },
Tom Rini31df83b2022-11-19 18:45:27 -0500354#if defined(CONFIG_MX51) || \
Peng Fanfa94fb42018-01-10 13:20:42 +0800355 defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
Peng Fan39945c12018-11-20 10:19:25 +0000356 defined(CONFIG_IMX8M) || defined(CONFIG_ARCH_IMX8)
Peng Fan0ed2cb12015-02-10 14:46:34 +0800357 { 3, (struct gpio_regs *)GPIO4_BASE_ADDR },
358#endif
Tom Rini31df83b2022-11-19 18:45:27 -0500359#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
Peng Fan39945c12018-11-20 10:19:25 +0000360 defined(CONFIG_IMX8M) || defined(CONFIG_ARCH_IMX8)
Peng Fan0ed2cb12015-02-10 14:46:34 +0800361 { 4, (struct gpio_regs *)GPIO5_BASE_ADDR },
Peng Fan39945c12018-11-20 10:19:25 +0000362#ifndef CONFIG_IMX8M
Peng Fan0ed2cb12015-02-10 14:46:34 +0800363 { 5, (struct gpio_regs *)GPIO6_BASE_ADDR },
364#endif
Peng Fanfa94fb42018-01-10 13:20:42 +0800365#endif
Peng Fanb2242e12018-10-18 14:28:27 +0200366#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_ARCH_IMX8)
Peng Fan0ed2cb12015-02-10 14:46:34 +0800367 { 6, (struct gpio_regs *)GPIO7_BASE_ADDR },
368#endif
Peng Fanb2242e12018-10-18 14:28:27 +0200369#if defined(CONFIG_ARCH_IMX8)
370 { 7, (struct gpio_regs *)GPIO8_BASE_ADDR },
371#endif
Simon Glass2772b4d2014-10-01 19:57:26 -0600372};
373
Simon Glass1d8364a2020-12-28 20:34:54 -0700374U_BOOT_DRVINFOS(mxc_gpios) = {
Simon Glass2772b4d2014-10-01 19:57:26 -0600375 { "gpio_mxc", &mxc_plat[0] },
376 { "gpio_mxc", &mxc_plat[1] },
377 { "gpio_mxc", &mxc_plat[2] },
Tom Rini31df83b2022-11-19 18:45:27 -0500378#if defined(CONFIG_MX51) || \
Peng Fanfa94fb42018-01-10 13:20:42 +0800379 defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
Peng Fan39945c12018-11-20 10:19:25 +0000380 defined(CONFIG_IMX8M) || defined(CONFIG_ARCH_IMX8)
Simon Glass2772b4d2014-10-01 19:57:26 -0600381 { "gpio_mxc", &mxc_plat[3] },
382#endif
Tom Rini31df83b2022-11-19 18:45:27 -0500383#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || \
Peng Fan39945c12018-11-20 10:19:25 +0000384 defined(CONFIG_IMX8M) || defined(CONFIG_ARCH_IMX8)
Simon Glass2772b4d2014-10-01 19:57:26 -0600385 { "gpio_mxc", &mxc_plat[4] },
Peng Fan39945c12018-11-20 10:19:25 +0000386#ifndef CONFIG_IMX8M
Simon Glass2772b4d2014-10-01 19:57:26 -0600387 { "gpio_mxc", &mxc_plat[5] },
388#endif
Peng Fanfa94fb42018-01-10 13:20:42 +0800389#endif
Peng Fanb2242e12018-10-18 14:28:27 +0200390#if defined(CONFIG_MX53) || defined(CONFIG_MX6) || defined(CONFIG_ARCH_IMX8)
Simon Glass2772b4d2014-10-01 19:57:26 -0600391 { "gpio_mxc", &mxc_plat[6] },
392#endif
Peng Fanb2242e12018-10-18 14:28:27 +0200393#if defined(CONFIG_ARCH_IMX8)
394 { "gpio_mxc", &mxc_plat[7] },
395#endif
Simon Glass2772b4d2014-10-01 19:57:26 -0600396};
397#endif
Peng Fan0ed2cb12015-02-10 14:46:34 +0800398#endif