]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm:gpio:mxc add DT support
authorPeng Fan <Peng.Fan@freescale.com>
Tue, 10 Feb 2015 06:46:34 +0000 (14:46 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 19:13:34 +0000 (21:13 +0200)
This patch add DT support for mxc gpio driver.

There are one place using CONFIG_OF_CONTROL macro.
1. The U_BOOT_DEVICES and mxc_plat array are complied out. To DT,
   platdata is alloced using calloc, so there is no need to use mxc_plat.

The following situations are tested, and all work fine:
1. with DM, without DT
2. with DM and DT
3. without DM
Since device tree has not been upstreamed, if want to test this patch.
The followings need to be done.
 + pieces of code does not gpio_request when using gpio_direction_xxx and
   etc, need to request gpio.
 + move the gpio settings from board_early_init_f to board_init
 + define CONFIG_DM ,CONFIG_DM_GPIO and CONFIG_OF_CONTROL
 + Add device tree file and do related configuration in
   `make ARCH=arm menuconfig`
These will be done in future patches by step.

Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
drivers/gpio/mxc_gpio.c

index 02181ec8193a4ce81068adcfbf28d63aab999433..e8aca171a95e81b7fb3aa80586c19b7d5cf3cf84 100644 (file)
@@ -280,23 +280,6 @@ static const struct dm_gpio_ops gpio_mxc_ops = {
        .get_function           = mxc_gpio_get_function,
 };
 
-static const struct mxc_gpio_plat mxc_plat[] = {
-       { 0, (struct gpio_regs *)GPIO1_BASE_ADDR },
-       { 1, (struct gpio_regs *)GPIO2_BASE_ADDR },
-       { 2, (struct gpio_regs *)GPIO3_BASE_ADDR },
-#if defined(CONFIG_MX25) || defined(CONFIG_MX27) || defined(CONFIG_MX51) || \
-               defined(CONFIG_MX53) || defined(CONFIG_MX6)
-       { 3, (struct gpio_regs *)GPIO4_BASE_ADDR },
-#endif
-#if defined(CONFIG_MX27) || defined(CONFIG_MX53) || defined(CONFIG_MX6)
-       { 4, (struct gpio_regs *)GPIO5_BASE_ADDR },
-       { 5, (struct gpio_regs *)GPIO6_BASE_ADDR },
-#endif
-#if defined(CONFIG_MX53) || defined(CONFIG_MX6)
-       { 6, (struct gpio_regs *)GPIO7_BASE_ADDR },
-#endif
-};
-
 static int mxc_gpio_probe(struct udevice *dev)
 {
        struct mxc_bank_info *bank = dev_get_priv(dev);