public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 0/23] dm: Introduce driver model for sunxi
@ 2014-10-04 17:29 Simon Glass
  2014-10-04 17:29 ` [U-Boot] [PATCH 01/23] dm: sunxi: dts: Add sun7i device tree files Simon Glass
                   ` (23 more replies)
  0 siblings, 24 replies; 48+ messages in thread
From: Simon Glass @ 2014-10-04 17:29 UTC (permalink / raw)
  To: u-boot

This series adds driver model support for serial and GPIO for sunxi. Since
I only have a sun7i board to test with, I have added a new config for the
pcDuino3, which uses device tree and driver model. This should make it
fairly easy to enable for the other boards at some point.

Now that we have about 5 GPIO drivers it is clear that the request()/free()
logic should be in the uclass rather than the driver. So far drivers don't
have to do anything in those methods except adjust pin configuration.
Patches are included to make this change, including removing the redundant
code in the various GPIO drivers. The sunxi driver works the same way.

So far at least GPIO drivers don't tend to have anything special to report
for the 'gpio status' command. Partly this is because we only support a
simple concept of GPIOs so far (no drive strength, function selection,
etc.) but even if this were to be supported it would be better to handle
it generically where possible. So the get_state() call can be replaced with
a generic one in the uclass. This can be implemented with the existing
uclass interface: get_function() to find out if the pin is set as an input,
output or not a GPIO, and get_value() to find its value.

As a result, it is safe to remove the get_state() method, and this series
does that also.

This series is available at u-boot-dm/sunix-working.


Simon Glass (23):
  dm: sunxi: dts: Add sun7i device tree files
  dm: sunxi: Add a new config for an FDT-based pcDuino3
  dm: core: Add support for simple-bus
  dm: sunxi: Add pinmux functions which take a bank parameter
  dm: sunxi: Make sure that GPIOs are requested
  dm: sunxi: Modify the GPIO driver to support driver model
  dm: sunxi: Add support for serial using driver model
  dm: gpio: Implement GPIO reservation in the uclass
  dm: gpio: Add gpio_get_function() and friends
  dm: Move the function for getting GPIO status into the uclass
  dm: gpio: sandbox: Implement the get_function() method
  dm: gpio: sandbox: Implement the remove() method
  dm: gpio: sandbox: Drop request()/free() in the driver
  test: dm: Update GPIO tests for new gpio_request() method
  dm: gpio: Add gpio_requestf() helper for printf() strings
  test: dm: Support memory leak checking as a core feature
  test: dm: Add additional GPIO tests
  dm: gpio: tegra: Drop request()/free() in the driver
  dm: gpio: omap3: Drop request()/free() in the driver
  dm: gpio: rpi_b: Drop request()/free() in the driver
  dm: gpio: exynos: Drop request()/free() in the driver
  dm: gpio: imx: Drop request()/free() in the driver
  dm: gpio: Remove unused get_state() uclass method

 Makefile                                  |   3 +-
 arch/arm/cpu/armv7/sunxi/pinmux.c         |  32 +-
 arch/arm/dts/Makefile                     |   1 +
 arch/arm/dts/sun7i-a20-pcduino3.dts       | 177 ++++++
 arch/arm/dts/sun7i-a20.dtsi               | 988 ++++++++++++++++++++++++++++++
 arch/arm/dts/sunxi-common-regulators.dtsi |  89 +++
 arch/arm/include/asm/arch-sunxi/gpio.h    |   4 +-
 board/sunxi/MAINTAINERS                   |   1 +
 board/sunxi/ahci.c                        |   1 +
 common/cmd_gpio.c                         |  57 +-
 configs/Linksprite_pcDuino3_fdt_defconfig |   8 +
 doc/driver-model/README.txt               |  29 +-
 drivers/core/Makefile                     |   1 +
 drivers/core/simple-bus.c                 |  33 +
 drivers/gpio/bcm2835_gpio.c               |  89 ---
 drivers/gpio/gpio-uclass.c                | 199 +++++-
 drivers/gpio/mxc_gpio.c                   | 116 ----
 drivers/gpio/omap_gpio.c                  | 116 +---
 drivers/gpio/s5p_gpio.c                   | 101 ---
 drivers/gpio/sandbox.c                    |  93 +--
 drivers/gpio/sunxi_gpio.c                 | 170 +++++
 drivers/gpio/tegra_gpio.c                 | 110 ----
 drivers/serial/Makefile                   |   1 +
 drivers/serial/serial_dw.c                |  39 ++
 include/asm-generic/gpio.h                |  70 ++-
 include/configs/sun7i.h                   |   8 +
 include/configs/sunxi-common.h            |  12 +-
 include/dm/test.h                         |  23 +
 include/dm/uclass-id.h                    |   1 +
 include/dt-bindings/input/input.h         | 525 ++++++++++++++++
 test/dm/core.c                            |  46 +-
 test/dm/gpio.c                            | 111 +++-
 test/dm/test-main.c                       |   2 +
 33 files changed, 2534 insertions(+), 722 deletions(-)
 create mode 100644 arch/arm/dts/sun7i-a20-pcduino3.dts
 create mode 100644 arch/arm/dts/sun7i-a20.dtsi
 create mode 100644 arch/arm/dts/sunxi-common-regulators.dtsi
 create mode 100644 configs/Linksprite_pcDuino3_fdt_defconfig
 create mode 100644 drivers/core/simple-bus.c
 create mode 100644 drivers/serial/serial_dw.c
 create mode 100644 include/dt-bindings/input/input.h

-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply	[flat|nested] 48+ messages in thread

end of thread, other threads:[~2014-10-24  3:53 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-04 17:29 [U-Boot] [PATCH 0/23] dm: Introduce driver model for sunxi Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 01/23] dm: sunxi: dts: Add sun7i device tree files Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 02/23] dm: sunxi: Add a new config for an FDT-based pcDuino3 Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 03/23] dm: core: Add support for simple-bus Simon Glass
2014-10-23  3:06   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 04/23] dm: sunxi: Add pinmux functions which take a bank parameter Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 05/23] dm: sunxi: Make sure that GPIOs are requested Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 06/23] dm: sunxi: Modify the GPIO driver to support driver model Simon Glass
2014-10-05  2:07   ` Chen-Yu Tsai
2014-10-04 17:29 ` [U-Boot] [PATCH 07/23] dm: sunxi: Add support for serial using " Simon Glass
2014-10-05 14:50   ` Chen-Yu Tsai
2014-10-04 17:29 ` [U-Boot] [PATCH 08/23] dm: gpio: Implement GPIO reservation in the uclass Simon Glass
2014-10-24  3:52   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 09/23] dm: gpio: Add gpio_get_function() and friends Simon Glass
2014-10-24  3:52   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 10/23] dm: Move the function for getting GPIO status into the uclass Simon Glass
2014-10-24  3:52   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 11/23] dm: gpio: sandbox: Implement the get_function() method Simon Glass
2014-10-24  3:52   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 12/23] dm: gpio: sandbox: Implement the remove() method Simon Glass
2014-10-24  3:52   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 13/23] dm: gpio: sandbox: Drop request()/free() in the driver Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 14/23] test: dm: Update GPIO tests for new gpio_request() method Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 15/23] dm: gpio: Add gpio_requestf() helper for printf() strings Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 16/23] test: dm: Support memory leak checking as a core feature Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 17/23] test: dm: Add additional GPIO tests Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 18/23] dm: gpio: tegra: Drop request()/free() in the driver Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 19/23] dm: gpio: omap3: " Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 20/23] dm: gpio: rpi_b: " Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 21/23] dm: gpio: exynos: " Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 22/23] dm: gpio: imx: " Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-04 17:29 ` [U-Boot] [PATCH 23/23] dm: gpio: Remove unused get_state() uclass method Simon Glass
2014-10-24  3:53   ` Simon Glass
2014-10-08 19:27 ` [U-Boot] [PATCH 0/23] dm: Introduce driver model for sunxi Simon Glass
2014-10-09  7:59   ` Ian Campbell
2014-10-09  8:13     ` Hans de Goede
2014-10-10  3:44       ` Simon Glass
2014-10-23 19:20         ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox