[U-Boot] [PATCH v3 1/3] dm: gpio: Add driver for MPC85XX GPIO controller

Simon Glass sjg at chromium.org
Thu May 19 06:02:29 CEST 2016


On 13 May 2016 at 05:15, Mario Six <mario.six at gdsys.cc> wrote:
> From: "mario.six at gdsys.cc" <mario.six at gdsys.cc>
>
> This patch adds a driver for the built-in GPIO controller of the MPC85XX
> SoC (probably supporting other PowerQUICC III SoCs as well).
>
> Each GPIO bank is identified by its own entry in the device tree, i.e.
>
> gpio-controller at fc00 {
>       #gpio-cells = <2>;
>       compatible = "fsl,pq3-gpio";
>       reg = <0xfc00 0x100>
> }
>
> By default, each bank is assumed to have 32 GPIOs, but the ngpios
> setting is honored, so the number of GPIOs for each bank in configurable
> to match the actual GPIO count of the SoC (e.g. the 32/32/23 banks of
> the P1022 SoC).
>
> The usual functions of GPIO drivers (setting input/output mode and output
> value setting) are supported.
>
> The driver has been tested on MPC85XX, but it is likely that other
> PowerQUICC III devices will work as well.
>
> Signed-off-by: Mario Six <mario.six at gdsys.cc>
> ---
>
> v3:
> - Added shadow for the GPDAT register, as suggested by Joakim Tjernlund
> - Switched to u32 for bit masks
> - Added some comments
>
> v2:
> - Added missing commit message
> - Improved the Kconfig description
> - Fixed and documented the mpc85xx_gpio_data members
> - Introduced GPIO_MASK macro to simplify the code
> - Fixed white space issues in function headers
> - Removed unnecessary empty line
> - Use fdtdec_get_addr_size_auto_noparent to read the register base data
>
> ---
>  arch/powerpc/include/asm/arch-mpc85xx/gpio.h |   2 +
>  arch/powerpc/include/asm/immap_85xx.h        |   2 +
>  drivers/gpio/Kconfig                         |  25 ++++
>  drivers/gpio/Makefile                        |   1 +
>  drivers/gpio/mpc85xx_gpio.c                  | 187 +++++++++++++++++++++++++++
>  5 files changed, 217 insertions(+)
>  create mode 100644 drivers/gpio/mpc85xx_gpio.c

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list