Hi everyone, here's the the new version of CLK, RESET and PINCTRL drivers to configure sunxi from the device-tree. This adds support for the upstream CCU node (for reset and pinctrl) and tries to address the various concerns people had.
Note that (to stay in sync with the Linux files), some of the patches may not fully adhere to the style (e.g. some of the code reused verbatim from Linux and in the config tables). This has been tested with Ethernet, I2C, SPI and MMC on the A64-uQ7. See my separate patchsets for the conversion of these drivers over to support DM-based CLK, RESET and PINCTRL configuration. Changes is v3: * add support for the 'new-style' clock subsystem (CCU) by porting from Linux and adding the necessary glue implementation - add a CCU reset-driver (in addition to the legacy driver, which will still be required for the R_* device nodes), which reuses the reset-table from ccu-<SOC>.c - add a clk-sunxi-ccu.c implementation based on Linux and reusing both the low-level clock implementation (ccu_*.h) and the config table (ccu-<SOC>.c) from Linux * reuse the 'allwinner,pinctrl.txt' documentation for the pinctrl binding from Linux * adds the includes for the CCU dt-bindings from Linux * adds support for printing the CCU subsystem via 'clk dump' Philipp Tomsich (9): sunxi: add pinctrl (UCLASS_PINCTRL) support for sunxi dm: core: Allow multiple drivers to bind for a single node sunxi: CONFIG_DM_ALLOW_MULTIPLE_DRIVERS for gpio/pinctrl binding Kconfig: sunxi: Select new option for allow multiple drivers to bind sunxi: add module reset (UCLASS_RESET) support for sunxi linux/kernel.h: sync DIV_ROUND_UP_ULL from kernel clk: clk-uclass: add clk_get_by_output_name sunxi: add clock driver (UCLASS_CLK) support for sunxi cmd: move CONFIG_CMD_CLK to Kconfig arch/arm/Kconfig | 1 + arch/arm/include/asm/arch-sunxi/gpio-internal.h | 19 + cmd/Kconfig | 10 + .../pinctrl/allwinner,pinctrl.txt | 142 ++++ drivers/clk/Makefile | 1 + drivers/clk/clk-uclass.c | 30 + drivers/clk/sunxi/Makefile | 30 + drivers/clk/sunxi/ccu-compatibility.h | 232 ++++++ drivers/clk/sunxi/ccu-runtime-divider.c | 115 +++ drivers/clk/sunxi/ccu-runtime-fixedfactor.c | 17 + drivers/clk/sunxi/ccu-sun50i-a64.c | 810 +++++++++++++++++++++ drivers/clk/sunxi/ccu-sun50i-a64.h | 64 ++ drivers/clk/sunxi/ccu_common.c | 27 + drivers/clk/sunxi/ccu_common.h | 67 ++ drivers/clk/sunxi/ccu_div.c | 134 ++++ drivers/clk/sunxi/ccu_div.h | 170 +++++ drivers/clk/sunxi/ccu_frac.c | 106 +++ drivers/clk/sunxi/ccu_frac.h | 46 ++ drivers/clk/sunxi/ccu_gate.c | 80 ++ drivers/clk/sunxi/ccu_gate.h | 45 ++ drivers/clk/sunxi/ccu_mp.c | 159 ++++ drivers/clk/sunxi/ccu_mp.h | 70 ++ drivers/clk/sunxi/ccu_mult.h | 39 + drivers/clk/sunxi/ccu_mux.c | 201 +++++ drivers/clk/sunxi/ccu_mux.h | 105 +++ drivers/clk/sunxi/ccu_nk.c | 154 ++++ drivers/clk/sunxi/ccu_nk.h | 64 ++ drivers/clk/sunxi/ccu_nkm.c | 184 +++++ drivers/clk/sunxi/ccu_nkm.h | 84 +++ drivers/clk/sunxi/ccu_nkmp.c | 171 +++++ drivers/clk/sunxi/ccu_nkmp.h | 64 ++ drivers/clk/sunxi/ccu_nm.c | 148 ++++ drivers/clk/sunxi/ccu_nm.h | 84 +++ drivers/clk/sunxi/clk-sunxi-ccu.c | 550 ++++++++++++++ drivers/clk/sunxi/clk-sunxi-gate.c | 92 +++ drivers/clk/sunxi/clk-sunxi-mod.c | 241 ++++++ drivers/core/Kconfig | 14 + drivers/core/lists.c | 12 +- drivers/gpio/sunxi_gpio.c | 15 +- drivers/pinctrl/Kconfig | 10 + drivers/pinctrl/Makefile | 2 + drivers/pinctrl/sunxi/Makefile | 10 + drivers/pinctrl/sunxi/pinctrl-sun50i-a64-r.c | 92 +++ drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c | 577 +++++++++++++++ drivers/pinctrl/sunxi/pinctrl-sunxi.c | 355 +++++++++ drivers/pinctrl/sunxi/pinctrl-sunxi.h | 311 ++++++++ drivers/reset/Kconfig | 9 + drivers/reset/Makefile | 1 + drivers/reset/sunxi/Makefile | 6 + drivers/reset/sunxi/ccu-sun50i-a64.c | 75 ++ drivers/reset/sunxi/ccu_reset.h | 9 + drivers/reset/sunxi/reset-sunxi.c | 168 +++++ include/clk.h | 22 + include/dt-bindings/clock/sun50i-a64-ccu.h | 134 ++++ include/dt-bindings/reset/sun50i-a64-ccu.h | 98 +++ include/linux/kernel.h | 2 + 56 files changed, 6470 insertions(+), 8 deletions(-) create mode 100644 arch/arm/include/asm/arch-sunxi/gpio-internal.h create mode 100644 doc/device-tree-bindings/pinctrl/allwinner,pinctrl.txt create mode 100644 drivers/clk/sunxi/Makefile create mode 100644 drivers/clk/sunxi/ccu-compatibility.h create mode 100644 drivers/clk/sunxi/ccu-runtime-divider.c create mode 100644 drivers/clk/sunxi/ccu-runtime-fixedfactor.c create mode 100644 drivers/clk/sunxi/ccu-sun50i-a64.c create mode 100644 drivers/clk/sunxi/ccu-sun50i-a64.h create mode 100644 drivers/clk/sunxi/ccu_common.c create mode 100644 drivers/clk/sunxi/ccu_common.h create mode 100644 drivers/clk/sunxi/ccu_div.c create mode 100644 drivers/clk/sunxi/ccu_div.h create mode 100644 drivers/clk/sunxi/ccu_frac.c create mode 100644 drivers/clk/sunxi/ccu_frac.h create mode 100644 drivers/clk/sunxi/ccu_gate.c create mode 100644 drivers/clk/sunxi/ccu_gate.h create mode 100644 drivers/clk/sunxi/ccu_mp.c create mode 100644 drivers/clk/sunxi/ccu_mp.h create mode 100644 drivers/clk/sunxi/ccu_mult.h create mode 100644 drivers/clk/sunxi/ccu_mux.c create mode 100644 drivers/clk/sunxi/ccu_mux.h create mode 100644 drivers/clk/sunxi/ccu_nk.c create mode 100644 drivers/clk/sunxi/ccu_nk.h create mode 100644 drivers/clk/sunxi/ccu_nkm.c create mode 100644 drivers/clk/sunxi/ccu_nkm.h create mode 100644 drivers/clk/sunxi/ccu_nkmp.c create mode 100644 drivers/clk/sunxi/ccu_nkmp.h create mode 100644 drivers/clk/sunxi/ccu_nm.c create mode 100644 drivers/clk/sunxi/ccu_nm.h create mode 100644 drivers/clk/sunxi/clk-sunxi-ccu.c create mode 100644 drivers/clk/sunxi/clk-sunxi-gate.c create mode 100644 drivers/clk/sunxi/clk-sunxi-mod.c create mode 100644 drivers/pinctrl/sunxi/Makefile create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun50i-a64-r.c create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun50i-a64.c create mode 100644 drivers/pinctrl/sunxi/pinctrl-sunxi.c create mode 100644 drivers/pinctrl/sunxi/pinctrl-sunxi.h create mode 100644 drivers/reset/sunxi/Makefile create mode 100644 drivers/reset/sunxi/ccu-sun50i-a64.c create mode 100644 drivers/reset/sunxi/ccu_reset.h create mode 100644 drivers/reset/sunxi/reset-sunxi.c create mode 100644 include/dt-bindings/clock/sun50i-a64-ccu.h create mode 100644 include/dt-bindings/reset/sun50i-a64-ccu.h -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/listinfo/u-boot