sunxi: Add initial CLK, RESET support
Subsystems (14)
cover sunxi: Add initial CLK, RESET support
This is series is trying to add initial support for CLK and RESET drivers for Allwinner SoC's with USB as a starting IP.
Linux handle both clock and reset as ccu with common DT bindings, but besides that U-Boot handle them separately with individual generic uclass functions. So we need have a separate drivers for CLK and RESET with common DT binding.
This series is trying to resolve this by binding the reset driver from CLK driver .bind call. First of all the CLK driver will probe based on DT compatible and the .bind call of CLK driver will bind the respective reset driver based on uclass driver name.
I would prefer USB can be initial IP to go, since it doesn't rely on dm pinctrl or any other dm stuff require.
Tested this on A64, H5, H3 but I still need to have closer look on other SoCs.
All these changes available at u-boot-sunxi/clk
Suggestions,
Jagan.
Andre Przywara (1):
sunxi: clk: add DM clock driver template for the A64 SoC
Jagan Teki (34):
clk: Kconfig: Ascending order to sub directiory kconfigs
net: sun8i_emac: Make proper order for include files
mtd: sunxi_nand_spl: Make proper order for include files
dt-bindings: reset: Sync sun4i-a10-ccu.h from Linux
dt-bindings: clock: Sync sun5i-ccu.h from Linux
dt-bindings: reset: Sync sun5i-ccu.h from Linux
dt-bindings: clock: Sync sun6i-a31-ccu.h from Linux
dt-bindings: reset: Sync sun6i-a31-ccu.h from Linux
clk: sunxi: Add Kconfig entry
clk: sunxi: a64: Add disable function
clk: sunxi: a64: Implement USB clocks
reset: sunxi: Add DM reset driver template for the A64 SoC
reset: sunxi: a64: Bind reset from clock driver
reset: Add default request ops
reset: sunxi: a64: Implement USB resets
clk: sunxi: Add initial CLK driver for H3_H5
reset: sunxi: Add initial RESET driver for H3_H5
clk: sunxi: Add initial CLK driver for A10/A20
reset: sunxi: Add initial RESET driver for A10/A20
clk: sunxi: Add initial CLK driver for A10s/A13
reset: sunxi: Add initial RESET driver for A10s/A13
clk: sunxi: Add initial CLK driver for A31/A31s
reset: sunxi: Add initial RESET driver for A31/A31s
clk: sunxi: Add initial CLK driver for A23
reset: sunxi: Add initial RESET driver for A23
clk: sunxi: a23: Add CLK support for A33
reset: sunxi: a23: Add RESET support A33
clk: sunxi: Add initial CLK driver for A83T
reset: sunxi: Add initial RESET driver for A83T
sunxi: Enable CLK and RESET
musb-new: sunxi: Use CLK and RESET support
phy: sun4i-usb: Use CLK and RESET support
sunxi: usb: Switch to Generic host controllers
usb: host: Drop [e-o]hci-sunxi drivers
arch/arm/include/asm/arch-sunxi/clock.h | 8 + arch/arm/mach-sunxi/Kconfig | 18 ++ configs/A10-OLinuXino-Lime_defconfig | 1 + configs/A10s-OLinuXino-M_defconfig | 1 + configs/A13-OLinuXinoM_defconfig | 1 + configs/A13-OLinuXino_defconfig | 1 + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 + configs/A20-OLinuXino-Lime2_defconfig | 1 + configs/A20-OLinuXino-Lime_defconfig | 1 + configs/A20-Olimex-SOM204-EVB_defconfig | 2 + configs/Auxtek-T003_defconfig | 1 + configs/Auxtek-T004_defconfig | 1 + configs/Bananapi_defconfig | 1 + configs/Bananapi_m2m_defconfig | 1 + configs/Bananapro_defconfig | 1 + configs/CHIP_defconfig | 1 + configs/CHIP_pro_defconfig | 1 + configs/CSQ_CS908_defconfig | 1 + configs/Colombus_defconfig | 1 + configs/Cubieboard2_defconfig | 1 + configs/Cubieboard_defconfig | 1 + configs/Cubietruck_plus_defconfig | 1 + configs/Hummingbird_A31_defconfig | 1 + configs/Itead_Ibox_A20_defconfig | 1 + configs/Linksprite_pcDuino3_Nano_defconfig | 1 + configs/Linksprite_pcDuino3_defconfig | 1 + configs/Linksprite_pcDuino_defconfig | 1 + configs/MK808C_defconfig | 1 + configs/Marsboard_A10_defconfig | 1 + configs/Mele_A1000G_quad_defconfig | 1 + configs/Mele_A1000_defconfig | 1 + configs/Mele_I7_defconfig | 1 + configs/Mele_M3_defconfig | 1 + configs/Mele_M5_defconfig | 1 + configs/Mele_M9_defconfig | 1 + configs/Mini-X_defconfig | 1 + configs/Orangepi_defconfig | 1 + configs/Orangepi_mini_defconfig | 1 + configs/Sinlinx_SinA31s_defconfig | 1 + configs/Sinlinx_SinA33_defconfig | 1 + configs/Sinovoip_BPI_M2_Plus_defconfig | 1 + configs/Sinovoip_BPI_M2_defconfig | 1 + configs/Sinovoip_BPI_M3_defconfig | 1 + configs/Wexler_TAB7200_defconfig | 1 + configs/Wobo_i5_defconfig | 1 + configs/a64-olinuxino_defconfig | 1 + configs/ba10_tv_box_defconfig | 1 + configs/bananapi_m1_plus_defconfig | 1 + configs/bananapi_m64_defconfig | 1 + configs/ga10h_v1_1_defconfig | 1 + configs/h8_homlet_v2_defconfig | 1 + configs/i12-tvbox_defconfig | 1 + configs/icnova-a20-swac_defconfig | 1 + configs/inet1_defconfig | 1 + configs/inet_q972_defconfig | 1 + configs/jesurun_q5_defconfig | 1 + configs/libretech_all_h3_cc_h2_plus_defconfig | 1 + configs/libretech_all_h3_cc_h3_defconfig | 1 + configs/libretech_all_h3_cc_h5_defconfig | 1 + configs/mixtile_loftq_defconfig | 1 + configs/mk802_a10s_defconfig | 1 + configs/mk802_defconfig | 1 + configs/mk802ii_defconfig | 1 + configs/nanopi_a64_defconfig | 1 + configs/nanopi_m1_defconfig | 1 + configs/nanopi_m1_plus_defconfig | 1 + configs/nanopi_neo2_defconfig | 1 + configs/nanopi_neo_air_defconfig | 1 + configs/nanopi_neo_defconfig | 1 + configs/nanopi_neo_plus2_defconfig | 1 + configs/orangepi_2_defconfig | 1 + configs/orangepi_lite_defconfig | 1 + configs/orangepi_one_defconfig | 1 + configs/orangepi_pc2_defconfig | 1 + configs/orangepi_pc_defconfig | 1 + configs/orangepi_pc_plus_defconfig | 1 + configs/orangepi_plus2e_defconfig | 1 + configs/orangepi_plus_defconfig | 1 + configs/orangepi_prime_defconfig | 1 + configs/orangepi_r1_defconfig | 1 + configs/orangepi_win_defconfig | 1 + configs/orangepi_zero_defconfig | 1 + configs/orangepi_zero_plus2_defconfig | 1 + configs/orangepi_zero_plus_defconfig | 1 + configs/parrot_r16_defconfig | 1 + configs/pine64_plus_defconfig | 1 + configs/r7-tv-dongle_defconfig | 1 + configs/sopine_baseboard_defconfig | 1 + configs/sun8i_a23_evb_defconfig | 1 + configs/sunxi_Gemei_G9_defconfig | 1 + configs/tbs_a711_defconfig | 1 + drivers/clk/Kconfig | 9 +- drivers/clk/Makefile | 1 + drivers/clk/sunxi/Kconfig | 60 +++++ drivers/clk/sunxi/Makefile | 15 ++ drivers/clk/sunxi/clk_a10.c | 105 ++++++++ drivers/clk/sunxi/clk_a10s.c | 105 ++++++++ drivers/clk/sunxi/clk_a23.c | 113 +++++++++ drivers/clk/sunxi/clk_a31.c | 130 ++++++++++ drivers/clk/sunxi/clk_a64.c | 141 +++++++++++ drivers/clk/sunxi/clk_a83t.c | 120 +++++++++ drivers/clk/sunxi/clk_h3.c | 131 ++++++++++ drivers/clk/sunxi/clk_sunxi.c | 39 +++ drivers/mtd/nand/sunxi_nand_spl.c | 4 +- drivers/net/sun8i_emac.c | 8 +- drivers/phy/allwinner/phy-sun4i-usb.c | 63 +++-- drivers/reset/Kconfig | 2 + drivers/reset/Makefile | 1 + drivers/reset/reset-uclass.c | 10 +- drivers/reset/sunxi/Kconfig | 61 +++++ drivers/reset/sunxi/Makefile | 13 + drivers/reset/sunxi/reset_a10.c | 95 +++++++ drivers/reset/sunxi/reset_a10s.c | 93 +++++++ drivers/reset/sunxi/reset_a23.c | 111 +++++++++ drivers/reset/sunxi/reset_a31.c | 123 +++++++++ drivers/reset/sunxi/reset_a64.c | 115 +++++++++ drivers/reset/sunxi/reset_a83t.c | 117 +++++++++ drivers/reset/sunxi/reset_h3.c | 121 +++++++++ drivers/usb/host/Kconfig | 2 + drivers/usb/host/Makefile | 2 - drivers/usb/host/ehci-sunxi.c | 204 --------------- drivers/usb/host/ohci-sunxi.c | 233 ------------------ drivers/usb/musb-new/sunxi.c | 82 +++--- include/configs/sun4i.h | 4 - include/configs/sun50i.h | 5 - include/configs/sun5i.h | 4 - include/configs/sun6i.h | 4 - include/configs/sun7i.h | 4 - include/configs/sun8i.h | 4 - include/configs/sunxi-common.h | 1 - include/dt-bindings/clock/sun5i-ccu.h | 106 ++++++++ include/dt-bindings/clock/sun6i-a31-ccu.h | 191 ++++++++++++++ include/dt-bindings/reset/sun4i-a10-ccu.h | 69 ++++++ include/dt-bindings/reset/sun5i-ccu.h | 32 +++ include/dt-bindings/reset/sun6i-a31-ccu.h | 106 ++++++++ scripts/config_whitelist.txt | 2 - 136 files changed, 2549 insertions(+), 528 deletions(-) create mode 100644 drivers/clk/sunxi/Kconfig create mode 100644 drivers/clk/sunxi/Makefile create mode 100644 drivers/clk/sunxi/clk_a10.c create mode 100644 drivers/clk/sunxi/clk_a10s.c create mode 100644 drivers/clk/sunxi/clk_a23.c create mode 100644 drivers/clk/sunxi/clk_a31.c create mode 100644 drivers/clk/sunxi/clk_a64.c create mode 100644 drivers/clk/sunxi/clk_a83t.c create mode 100644 drivers/clk/sunxi/clk_h3.c create mode 100644 drivers/clk/sunxi/clk_sunxi.c create mode 100644 drivers/reset/sunxi/Kconfig create mode 100644 drivers/reset/sunxi/Makefile create mode 100644 drivers/reset/sunxi/reset_a10.c create mode 100644 drivers/reset/sunxi/reset_a10s.c create mode 100644 drivers/reset/sunxi/reset_a23.c create mode 100644 drivers/reset/sunxi/reset_a31.c create mode 100644 drivers/reset/sunxi/reset_a64.c create mode 100644 drivers/reset/sunxi/reset_a83t.c create mode 100644 drivers/reset/sunxi/reset_h3.c delete mode 100644 drivers/usb/host/ehci-sunxi.c delete mode 100644 drivers/usb/host/ohci-sunxi.c create mode 100644 include/dt-bindings/clock/sun5i-ccu.h create mode 100644 include/dt-bindings/clock/sun6i-a31-ccu.h create mode 100644 include/dt-bindings/reset/sun4i-a10-ccu.h create mode 100644 include/dt-bindings/reset/sun5i-ccu.h create mode 100644 include/dt-bindings/reset/sun6i-a31-ccu.h
Signature · 1 line
2.17.1
RFC 1/35 clk: Kconfig: Ascending order to sub directiory kconfigs
sourcing of sub directiory kconfig files are not in proper order, so keep them in ascending order.
--- drivers/clk/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/Kconfig +4 -4
@@ -83,12 +83,12 @@ config CLK_STM32MP1 Enable the STM32 clock (RCC) driver. Enable support for manipulating STM32MP1's on-SoC clocks. -source "drivers/clk/tegra/Kconfig" -source "drivers/clk/uniphier/Kconfig" -source "drivers/clk/exynos/Kconfig" source "drivers/clk/at91/Kconfig" -source "drivers/clk/renesas/Kconfig" +source "drivers/clk/exynos/Kconfig" source "drivers/clk/mvebu/Kconfig" +source "drivers/clk/renesas/Kconfig" +source "drivers/clk/tegra/Kconfig" +source "drivers/clk/uniphier/Kconfig" config ICS8N3QV01 bool "Enable ICS8N3QV01 VCXO driver"
Signature · 1 line
2.17.1
RFC 2/35 net: sun8i_emac: Make proper order for include files
In reply to Jagan TekiMake proper ordering for include files to get rid
of build issues with arch/clock.h
--- drivers/net/sun8i_emac.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/sun8i_emac.c +4 -4
@@ -10,16 +10,16 @@* */ -#include <asm/io.h> -#include <asm/arch/clock.h> -#include <asm/arch/gpio.h> #include <common.h> #include <dm.h> #include <fdt_support.h> -#include <linux/err.h> #include <malloc.h> #include <miiphy.h> #include <net.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <asm/arch/gpio.h> +#include <linux/err.h> #include <dt-bindings/pinctrl/sun4i-a10.h> #ifdef CONFIG_DM_GPIO #include <asm-generic/gpio.h>
Signature · 1 line
2.17.1
RFC 3/35 mtd: sunxi_nand_spl: Make proper order for include files
In reply to Jagan TekiMake proper ordering for include files to get rid
of build issues with arch/clock.h
--- drivers/mtd/nand/sunxi_nand_spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/sunxi_nand_spl.c +2 -2
@@ -4,11 +4,11 @@* Copyright (c) 2015, AW-SOM Technologies <www.aw-som.com> */ -#include <asm/arch/clock.h> -#include <asm/io.h> #include <common.h> #include <config.h> #include <nand.h> +#include <asm/arch/clock.h> +#include <asm/io.h> #include <linux/ctype.h> /* registers */
Signature · 1 line
2.17.1
RFC 4/35 dt-bindings: reset: Sync sun4i-a10-ccu.h from Linux
In reply to Jagan TekiSync include/dt-bindings/reset/sun4i-a10-ccu.h from Linux with below commit details:
commit c84f5683f6e9fee78e054431d89121225ccb7464
Author: Priit Laes <[email protected]> Date: Wed Aug 23 20:23:29 2017 +0300
clk: sunxi-ng: Add sun4i/sun7i CCU driver
--- include/dt-bindings/reset/sun4i-a10-ccu.h | 69 +++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 include/dt-bindings/reset/sun4i-a10-ccu.h
include/dt-bindings/reset/sun4i-a10-ccu.h new file +69 -0
@@ -0,0 +1,69 @@ +/* +* Copyright (C) 2017 Priit Laes <[email protected]> +* +* This file is dual-licensed: you can use it either under the terms +* of the GPL or the X11 license, at your option. Note that this dual +* licensing only applies to this file, and not this project as a +* whole. +* +* a) This file is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This file is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* Or, alternatively, +* +* b) Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _DT_BINDINGS_RST_SUN4I_A10_H +#define _DT_BINDINGS_RST_SUN4I_A10_H + +#define RST_USB_PHY0 1 +#define RST_USB_PHY1 2 +#define RST_USB_PHY2 3 +#define RST_GPS 4 +#define RST_DE_BE0 5 +#define RST_DE_BE1 6 +#define RST_DE_FE0 7 +#define RST_DE_FE1 8 +#define RST_DE_MP 9 +#define RST_TVE0 10 +#define RST_TCON0 11 +#define RST_TVE1 12 +#define RST_TCON1 13 +#define RST_CSI0 14 +#define RST_CSI1 15 +#define RST_VE 16 +#define RST_ACE 17 +#define RST_LVDS 18 +#define RST_GPU 19 +#define RST_HDMI_H 20 +#define RST_HDMI_SYS 21 +#define RST_HDMI_AUDIO_DMA 22 + +#endif /* DT_BINDINGS_RST_SUN4I_A10_H */
Signature · 1 line
2.17.1
RFC 5/35 dt-bindings: clock: Sync sun5i-ccu.h from Linux
In reply to Jagan TekiSync include/dt-bindings/clock/sun5i-ccu.h from Linux with below commit details:
commit 0adad031ef5d0d89ee92d92964d3799685ea2387
Author: Maxime Ripard <[email protected]> Date: Wed May 17 09:40:37 2017 +0200
clk: sunxi-ng: sun5i: Export video PLLs
--- include/dt-bindings/clock/sun5i-ccu.h | 106 ++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 include/dt-bindings/clock/sun5i-ccu.h
include/dt-bindings/clock/sun5i-ccu.h new file +106 -0
@@ -0,0 +1,106 @@ +/* +* Copyright 2016 Maxime Ripard +* +* Maxime Ripard <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef _DT_BINDINGS_CLK_SUN5I_H_ +#define _DT_BINDINGS_CLK_SUN5I_H_ + +#define CLK_HOSC 1 + +#define CLK_PLL_VIDEO0_2X 9 + +#define CLK_PLL_VIDEO1_2X 16 +#define CLK_CPU 17 + +#define CLK_AHB_OTG 23 +#define CLK_AHB_EHCI 24 +#define CLK_AHB_OHCI 25 +#define CLK_AHB_SS 26 +#define CLK_AHB_DMA 27 +#define CLK_AHB_BIST 28 +#define CLK_AHB_MMC0 29 +#define CLK_AHB_MMC1 30 +#define CLK_AHB_MMC2 31 +#define CLK_AHB_NAND 32 +#define CLK_AHB_SDRAM 33 +#define CLK_AHB_EMAC 34 +#define CLK_AHB_TS 35 +#define CLK_AHB_SPI0 36 +#define CLK_AHB_SPI1 37 +#define CLK_AHB_SPI2 38 +#define CLK_AHB_GPS 39 +#define CLK_AHB_HSTIMER 40 +#define CLK_AHB_VE 41 +#define CLK_AHB_TVE 42 +#define CLK_AHB_LCD 43 +#define CLK_AHB_CSI 44 +#define CLK_AHB_HDMI 45 +#define CLK_AHB_DE_BE 46 +#define CLK_AHB_DE_FE 47 +#define CLK_AHB_IEP 48 +#define CLK_AHB_GPU 49 +#define CLK_APB0_CODEC 50 +#define CLK_APB0_SPDIF 51 +#define CLK_APB0_I2S 52 +#define CLK_APB0_PIO 53 +#define CLK_APB0_IR 54 +#define CLK_APB0_KEYPAD 55 +#define CLK_APB1_I2C0 56 +#define CLK_APB1_I2C1 57 +#define CLK_APB1_I2C2 58 +#define CLK_APB1_UART0 59 +#define CLK_APB1_UART1 60 +#define CLK_APB1_UART2 61 +#define CLK_APB1_UART3 62 +#define CLK_NAND 63 +#define CLK_MMC0 64 +#define CLK_MMC1 65 +#define CLK_MMC2 66 +#define CLK_TS 67 +#define CLK_SS 68 +#define CLK_SPI0 69 +#define CLK_SPI1 70 +#define CLK_SPI2 71 +#define CLK_IR 72 +#define CLK_I2S 73 +#define CLK_SPDIF 74 +#define CLK_KEYPAD 75 +#define CLK_USB_OHCI 76 +#define CLK_USB_PHY0 77 +#define CLK_USB_PHY1 78 +#define CLK_GPS 79 +#define CLK_DRAM_VE 80 +#define CLK_DRAM_CSI 81 +#define CLK_DRAM_TS 82 +#define CLK_DRAM_TVE 83 +#define CLK_DRAM_DE_FE 84 +#define CLK_DRAM_DE_BE 85 +#define CLK_DRAM_ACE 86 +#define CLK_DRAM_IEP 87 +#define CLK_DE_BE 88 +#define CLK_DE_FE 89 +#define CLK_TCON_CH0 90 + +#define CLK_TCON_CH1 92 +#define CLK_CSI 93 +#define CLK_VE 94 +#define CLK_CODEC 95 +#define CLK_AVS 96 +#define CLK_HDMI 97 +#define CLK_GPU 98 + +#define CLK_IEP 100 + +#endif /* _DT_BINDINGS_CLK_SUN5I_H_ */
Signature · 1 line
2.17.1
RFC 6/35 dt-bindings: reset: Sync sun5i-ccu.h from Linux
In reply to Jagan TekiSync include/dt-bindings/reset/sun5i-ccu.h from Linux with below commit details:
commit 5e73761786d6ff7e10c371703835528dee9306e3
Author: Maxime Ripard <[email protected]> Date: Tue Oct 4 10:09:58 2016 +0200
clk: sunxi-ng: Add sun5i CCU driver
--- include/dt-bindings/reset/sun5i-ccu.h | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/dt-bindings/reset/sun5i-ccu.h
include/dt-bindings/reset/sun5i-ccu.h new file +32 -0
@@ -0,0 +1,32 @@ +/* +* Copyright 2016 Maxime Ripard +* +* Maxime Ripard <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +*/ + +#ifndef _RST_SUN5I_H_ +#define _RST_SUN5I_H_ + +#define RST_USB_PHY0 0 +#define RST_USB_PHY1 1 +#define RST_GPS 2 +#define RST_DE_BE 3 +#define RST_DE_FE 4 +#define RST_TVE 5 +#define RST_LCD 6 +#define RST_CSI 7 +#define RST_VE 8 +#define RST_GPU 9 +#define RST_IEP 10 + +#endif /* _RST_SUN5I_H_ */
Signature · 1 line
2.17.1
RFC 7/35 dt-bindings: clock: Sync sun6i-a31-ccu.h from Linux
In reply to Jagan TekiSync include/dt-bindings/clock/sun6i-a31-ccu.h from Linux with below commit details:
commit 80815004a45fc68b6e34653af4fca47be7fb96ed
Author: Chen-Yu Tsai <[email protected]> Date: Fri Sep 29 16:22:53 2017 +0800
clk: sunxi-ng: sun6i: Export video PLLs
--- include/dt-bindings/clock/sun6i-a31-ccu.h | 191 ++++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 include/dt-bindings/clock/sun6i-a31-ccu.h
include/dt-bindings/clock/sun6i-a31-ccu.h new file +191 -0
@@ -0,0 +1,191 @@ +/* +* Copyright (C) 2016 Chen-Yu Tsai <[email protected]> +* +* This file is dual-licensed: you can use it either under the terms +* of the GPL or the X11 license, at your option. Note that this dual +* licensing only applies to this file, and not this project as a +* whole. +* +* a) This file is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This file is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* Or, alternatively, +* +* b) Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _DT_BINDINGS_CLK_SUN6I_A31_H_ +#define _DT_BINDINGS_CLK_SUN6I_A31_H_ + +#define CLK_PLL_VIDEO0_2X 7 + +#define CLK_PLL_PERIPH 10 + +#define CLK_PLL_VIDEO1_2X 13 + +#define CLK_CPU 18 + +#define CLK_AHB1_MIPIDSI 23 +#define CLK_AHB1_SS 24 +#define CLK_AHB1_DMA 25 +#define CLK_AHB1_MMC0 26 +#define CLK_AHB1_MMC1 27 +#define CLK_AHB1_MMC2 28 +#define CLK_AHB1_MMC3 29 +#define CLK_AHB1_NAND1 30 +#define CLK_AHB1_NAND0 31 +#define CLK_AHB1_SDRAM 32 +#define CLK_AHB1_EMAC 33 +#define CLK_AHB1_TS 34 +#define CLK_AHB1_HSTIMER 35 +#define CLK_AHB1_SPI0 36 +#define CLK_AHB1_SPI1 37 +#define CLK_AHB1_SPI2 38 +#define CLK_AHB1_SPI3 39 +#define CLK_AHB1_OTG 40 +#define CLK_AHB1_EHCI0 41 +#define CLK_AHB1_EHCI1 42 +#define CLK_AHB1_OHCI0 43 +#define CLK_AHB1_OHCI1 44 +#define CLK_AHB1_OHCI2 45 +#define CLK_AHB1_VE 46 +#define CLK_AHB1_LCD0 47 +#define CLK_AHB1_LCD1 48 +#define CLK_AHB1_CSI 49 +#define CLK_AHB1_HDMI 50 +#define CLK_AHB1_BE0 51 +#define CLK_AHB1_BE1 52 +#define CLK_AHB1_FE0 53 +#define CLK_AHB1_FE1 54 +#define CLK_AHB1_MP 55 +#define CLK_AHB1_GPU 56 +#define CLK_AHB1_DEU0 57 +#define CLK_AHB1_DEU1 58 +#define CLK_AHB1_DRC0 59 +#define CLK_AHB1_DRC1 60 + +#define CLK_APB1_CODEC 61 +#define CLK_APB1_SPDIF 62 +#define CLK_APB1_DIGITAL_MIC 63 +#define CLK_APB1_PIO 64 +#define CLK_APB1_DAUDIO0 65 +#define CLK_APB1_DAUDIO1 66 + +#define CLK_APB2_I2C0 67 +#define CLK_APB2_I2C1 68 +#define CLK_APB2_I2C2 69 +#define CLK_APB2_I2C3 70 +#define CLK_APB2_UART0 71 +#define CLK_APB2_UART1 72 +#define CLK_APB2_UART2 73 +#define CLK_APB2_UART3 74 +#define CLK_APB2_UART4 75 +#define CLK_APB2_UART5 76 + +#define CLK_NAND0 77 +#define CLK_NAND1 78 +#define CLK_MMC0 79 +#define CLK_MMC0_SAMPLE 80 +#define CLK_MMC0_OUTPUT 81 +#define CLK_MMC1 82 +#define CLK_MMC1_SAMPLE 83 +#define CLK_MMC1_OUTPUT 84 +#define CLK_MMC2 85 +#define CLK_MMC2_SAMPLE 86 +#define CLK_MMC2_OUTPUT 87 +#define CLK_MMC3 88 +#define CLK_MMC3_SAMPLE 89 +#define CLK_MMC3_OUTPUT 90 +#define CLK_TS 91 +#define CLK_SS 92 +#define CLK_SPI0 93 +#define CLK_SPI1 94 +#define CLK_SPI2 95 +#define CLK_SPI3 96 +#define CLK_DAUDIO0 97 +#define CLK_DAUDIO1 98 +#define CLK_SPDIF 99 +#define CLK_USB_PHY0 100 +#define CLK_USB_PHY1 101 +#define CLK_USB_PHY2 102 +#define CLK_USB_OHCI0 103 +#define CLK_USB_OHCI1 104 +#define CLK_USB_OHCI2 105 + +#define CLK_DRAM_VE 110 +#define CLK_DRAM_CSI_ISP 111 +#define CLK_DRAM_TS 112 +#define CLK_DRAM_DRC0 113 +#define CLK_DRAM_DRC1 114 +#define CLK_DRAM_DEU0 115 +#define CLK_DRAM_DEU1 116 +#define CLK_DRAM_FE0 117 +#define CLK_DRAM_FE1 118 +#define CLK_DRAM_BE0 119 +#define CLK_DRAM_BE1 120 +#define CLK_DRAM_MP 121 + +#define CLK_BE0 122 +#define CLK_BE1 123 +#define CLK_FE0 124 +#define CLK_FE1 125 +#define CLK_MP 126 +#define CLK_LCD0_CH0 127 +#define CLK_LCD1_CH0 128 +#define CLK_LCD0_CH1 129 +#define CLK_LCD1_CH1 130 +#define CLK_CSI0_SCLK 131 +#define CLK_CSI0_MCLK 132 +#define CLK_CSI1_MCLK 133 +#define CLK_VE 134 +#define CLK_CODEC 135 +#define CLK_AVS 136 +#define CLK_DIGITAL_MIC 137 +#define CLK_HDMI 138 +#define CLK_HDMI_DDC 139 +#define CLK_PS 140 + +#define CLK_MIPI_DSI 143 +#define CLK_MIPI_DSI_DPHY 144 +#define CLK_MIPI_CSI_DPHY 145 +#define CLK_IEP_DRC0 146 +#define CLK_IEP_DRC1 147 +#define CLK_IEP_DEU0 148 +#define CLK_IEP_DEU1 149 +#define CLK_GPU_CORE 150 +#define CLK_GPU_MEMORY 151 +#define CLK_GPU_HYD 152 +#define CLK_ATS 153 +#define CLK_TRACE 154 + +#define CLK_OUT_A 155 +#define CLK_OUT_B 156 +#define CLK_OUT_C 157 + +#endif /* _DT_BINDINGS_CLK_SUN6I_A31_H_ */
Signature · 1 line
2.17.1
RFC 8/35 dt-bindings: reset: Sync sun6i-a31-ccu.h from Linux
In reply to Jagan TekiSync include/dt-bindings/reset/sun6i-a31-ccu.h from Linux with below commit details:
commit c6e6c96d8fa6f21e80e625bdf56c9ef580f43acb
Author: Chen-Yu Tsai <[email protected]> Date: Thu Aug 25 14:21:59 2016 +0800
clk: sunxi-ng: Add A31/A31s clocks
--- include/dt-bindings/reset/sun6i-a31-ccu.h | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 include/dt-bindings/reset/sun6i-a31-ccu.h
include/dt-bindings/reset/sun6i-a31-ccu.h new file +106 -0
@@ -0,0 +1,106 @@ +/* +* Copyright (C) 2016 Chen-Yu Tsai <[email protected]> +* +* This file is dual-licensed: you can use it either under the terms +* of the GPL or the X11 license, at your option. Note that this dual +* licensing only applies to this file, and not this project as a +* whole. +* +* a) This file is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of the +* License, or (at your option) any later version. +* +* This file is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* Or, alternatively, +* +* b) Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _DT_BINDINGS_RST_SUN6I_A31_H_ +#define _DT_BINDINGS_RST_SUN6I_A31_H_ + +#define RST_USB_PHY0 0 +#define RST_USB_PHY1 1 +#define RST_USB_PHY2 2 + +#define RST_AHB1_MIPI_DSI 3 +#define RST_AHB1_SS 4 +#define RST_AHB1_DMA 5 +#define RST_AHB1_MMC0 6 +#define RST_AHB1_MMC1 7 +#define RST_AHB1_MMC2 8 +#define RST_AHB1_MMC3 9 +#define RST_AHB1_NAND1 10 +#define RST_AHB1_NAND0 11 +#define RST_AHB1_SDRAM 12 +#define RST_AHB1_EMAC 13 +#define RST_AHB1_TS 14 +#define RST_AHB1_HSTIMER 15 +#define RST_AHB1_SPI0 16 +#define RST_AHB1_SPI1 17 +#define RST_AHB1_SPI2 18 +#define RST_AHB1_SPI3 19 +#define RST_AHB1_OTG 20 +#define RST_AHB1_EHCI0 21 +#define RST_AHB1_EHCI1 22 +#define RST_AHB1_OHCI0 23 +#define RST_AHB1_OHCI1 24 +#define RST_AHB1_OHCI2 25 +#define RST_AHB1_VE 26 +#define RST_AHB1_LCD0 27 +#define RST_AHB1_LCD1 28 +#define RST_AHB1_CSI 29 +#define RST_AHB1_HDMI 30 +#define RST_AHB1_BE0 31 +#define RST_AHB1_BE1 32 +#define RST_AHB1_FE0 33 +#define RST_AHB1_FE1 34 +#define RST_AHB1_MP 35 +#define RST_AHB1_GPU 36 +#define RST_AHB1_DEU0 37 +#define RST_AHB1_DEU1 38 +#define RST_AHB1_DRC0 39 +#define RST_AHB1_DRC1 40 +#define RST_AHB1_LVDS 41 + +#define RST_APB1_CODEC 42 +#define RST_APB1_SPDIF 43 +#define RST_APB1_DIGITAL_MIC 44 +#define RST_APB1_DAUDIO0 45 +#define RST_APB1_DAUDIO1 46 +#define RST_APB2_I2C0 47 +#define RST_APB2_I2C1 48 +#define RST_APB2_I2C2 49 +#define RST_APB2_I2C3 50 +#define RST_APB2_UART0 51 +#define RST_APB2_UART1 52 +#define RST_APB2_UART2 53 +#define RST_APB2_UART3 54 +#define RST_APB2_UART4 55 +#define RST_APB2_UART5 56 + +#endif /* _DT_BINDINGS_RST_SUN6I_A31_H_ */
Signature · 1 line
2.17.1
RFC 9/35 sunxi: clk: add DM clock driver template for the A64 SoC
In reply to Jagan TekiFrom: Andre Przywara <[email protected]>
Create the template for a new DM clock driver for the Allwinner A64 SoC.
--- drivers/clk/Makefile | 1 + drivers/clk/sunxi/Makefile | 7 ++++ drivers/clk/sunxi/clk_a64.c | 77 +++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 drivers/clk/sunxi/Makefile create mode 100644 drivers/clk/sunxi/clk_a64.c
drivers/clk/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-y += tegra/ obj-$(CONFIG_ARCH_ASPEED) += aspeed/ obj-$(CONFIG_ARCH_MESON) += clk_meson.o obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/ +obj-$(CONFIG_ARCH_SUNXI) += sunxi/ obj-$(CONFIG_CLK_AT91) += at91/ obj-$(CONFIG_CLK_MVEBU) += mvebu/ obj-$(CONFIG_CLK_BCM6345) += clk_bcm6345.o
drivers/clk/sunxi/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (c) 2018 Arm Ltd. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-$(CONFIG_MACH_SUN50I) += clk_a64.o
drivers/clk/sunxi/clk_a64.c new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 10/35 clk: sunxi: Add Kconfig entry
In reply to Jagan TekiAdd proper kconfig entries for Allwinner platform, CLK_SUN50I_A64 is kconfig option for A64 clock driver.
--- drivers/clk/Kconfig | 1 + drivers/clk/sunxi/Kconfig | 18 ++++++++++++++++++ drivers/clk/sunxi/Makefile | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 drivers/clk/sunxi/Kconfig
drivers/clk/Kconfig +1 -0
@@ -87,6 +87,7 @@ source "drivers/clk/at91/Kconfig" source "drivers/clk/exynos/Kconfig" source "drivers/clk/mvebu/Kconfig" source "drivers/clk/renesas/Kconfig" +source "drivers/clk/sunxi/Kconfig" source "drivers/clk/tegra/Kconfig" source "drivers/clk/uniphier/Kconfig"
drivers/clk/sunxi/Kconfig new file +18 -0
@@ -0,0 +1,18 @@ +config CLK_SUNXI + bool "Clock support for Allwinner SoCs" + depends on ARCH_SUNXI + select CLK + help + This enables support for common clock driver API on Allwinner + SoCs. + +if CLK_SUNXI + +config CLK_SUN50I_A64 + bool "Clock driver for Allwinner A64" + default MACH_SUN50I + help + This enables common clock driver support for platforms based + on Allwinner A64 SoC. + +endif # CLK_SUNXI
drivers/clk/sunxi/Makefile +1 -1
@@ -4,4 +4,4 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-$(CONFIG_MACH_SUN50I) += clk_a64.o +obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
Signature · 1 line
2.17.1
RFC 11/35 clk: sunxi: a64: Add disable function
In reply to Jagan TekiAdd clock disable function for clearing register bits.
--- drivers/clk/sunxi/clk_a64.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/clk/sunxi/clk_a64.c +9 -0
@@ -41,10 +41,19 @@ static int a64_clk_enable(struct clk *clk)return -EINVAL ; } +static int a64_clk_disable (struct clk *clk) +{ +debug ("%s(#%ld)\n" , __func__, clk->id); + +debug (" unhandled\n" ); +return -EINVAL ; +} +static struct clk_ops a64_clk_ops = { .get_rate = a64_clk_get_rate, .set_rate = a64_clk_set_rate, .enable = a64_clk_enable, + .disable = a64_clk_disable, };static int a64_clk_probe (struct udevice *dev)
Signature · 1 line
2.17.1
RFC 12/35 clk: sunxi: a64: Implement USB clocks
In reply to Jagan TekiImplement USB clock enable and disble functions for OHCI, EHCI, OTG and USBPHY gate and clock registers.
--- drivers/clk/sunxi/clk_a64.c | 62 ++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 4 deletions(-)
drivers/clk/sunxi/clk_a64.c +58 -4
@@ -35,18 +35,72 @@ static ulong a64_clk_set_rate(struct clk *clk, ulong rate)static int a64_clk_enable (struct clk *clk) { +struct a64_clk_priv *priv =dev_get_priv (clk->dev); +debug ("%s(#%ld)\n" , __func__, clk->id); -debug (" unhandled\n" ); -return -EINVAL ; +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +setbits_le32 (priv->base +0x60 , +BIT (28 + (clk->id -CLK_BUS_OHCI0 ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +setbits_le32 (priv->base +0xcc ,BIT (16 )); +return 0 ; +case CLK_USB_OHCI1 : +setbits_le32 (priv->base +0xcc ,BIT (17 )); +return 0 ; +default : +debug (" unhandled\n" ); +return -ENODEV ; + } }static int a64_clk_disable (struct clk *clk) { +struct a64_clk_priv *priv =dev_get_priv (clk->dev); +debug ("%s(#%ld)\n" , __func__, clk->id); -debug (" unhandled\n" ); -return -EINVAL ; +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +clrbits_le32 (priv->base +0x60 , +BIT (28 + (clk->id -CLK_BUS_OHCI0 ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +clrbits_le32 (priv->base +0xcc ,BIT (16 )); +return 0 ; +case CLK_USB_OHCI1 : +clrbits_le32 (priv->base +0xcc ,BIT (17 )); +return 0 ; +default : +debug (" unhandled\n" ); +return -ENODEV ; + } }static struct clk_ops a64_clk_ops = {
Signature · 1 line
2.17.1
RFC 13/35 reset: sunxi: Add DM reset driver template for the A64 SoC
In reply to Jagan TekiCreate the template for a new DM reset driver for the Allwinner A64 SoC.
--- drivers/reset/Kconfig | 2 + drivers/reset/Makefile | 1 + drivers/reset/sunxi/Kconfig | 19 ++++++++++ drivers/reset/sunxi/Makefile | 7 ++++ drivers/reset/sunxi/reset_a64.c | 67 +++++++++++++++++++++++++++++++++ 5 files changed, 96 insertions(+) create mode 100644 drivers/reset/sunxi/Kconfig create mode 100644 drivers/reset/sunxi/Makefile create mode 100644 drivers/reset/sunxi/reset_a64.c
drivers/reset/Kconfig +2 -0
@@ -98,4 +98,6 @@ config RESET_SOCFPGA help Support for reset controller on SoCFPGA platform. +source "drivers/reset/sunxi/Kconfig" + endmenu
drivers/reset/Makefile +1 -0
@@ -15,3 +15,4 @@ obj-$(CONFIG_AST2500_RESET) += ast2500-reset.o obj-$(CONFIG_RESET_ROCKCHIP) += reset-rockchip.o obj-$(CONFIG_RESET_MESON) += reset-meson.o obj-$(CONFIG_RESET_SOCFPGA) += reset-socfpga.o +obj-$(CONFIG_RESET_SUNXI) += sunxi/
drivers/reset/sunxi/Kconfig new file +19 -0
@@ -0,0 +1,19 @@ +config RESET_SUNXI + bool "RESET support for Allwinner SoCs" + depends on ARCH_SUNXI + depends on CLK_SUNXI + select DM_RESET + help + This enables support for common reset driver API on Allwinner + SoCs. + +if RESET_SUNXI + +config RESET_SUN50I_A64 + bool "Reset driver for Allwinner A64" + default MACH_SUN50I + help + This enables common reset driver support for platforms based + on Allwinner A64 SoC. + +endif # RESET_SUNXI
drivers/reset/sunxi/Makefile new file +7 -0
@@ -0,0 +1,7 @@ +# +# Copyright (C) 2018 Amarula Solutions +# +# SPDX-License-Identifier: GPL-2.0+ +# + +obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_a64.c new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 14/35 reset: sunxi: a64: Bind reset from clock driver
In reply to Jagan TekiSince clock and reset drivers have same DT node, we cann't follow another binding for reset so bind the reset driver from clock driver.
Binding here rely on name of the uclass driver rather than matching id.
So, this patch will pick the clock driver name as input and replace the sunfix ccu with reset. This logic is suggested by 'Chakra Divi'
--- arch/arm/include/asm/arch-sunxi/clock.h | 8 +++++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk_a64.c | 1 + drivers/clk/sunxi/clk_sunxi.c | 39 +++++++++++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 drivers/clk/sunxi/clk_sunxi.c
arch/arm/include/asm/arch-sunxi/clock.h +8 -0
@@ -34,4 +34,12 @@ void clock_init_sec(void);void clock_init_uart (void );#endif +/* +* sunxi_clk_bind() - Bind reset device as child of clock device +* +* @cdev: clock udevice +* @return 0 success, or error value +*/ +int sunxi_clk_bind (struct udevice *cdev); +#endif /* _SUNXI_CLOCK_H */
drivers/clk/sunxi/Makefile +1 -0
@@ -4,4 +4,5 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_a64.c +1 -0
@@ -137,4 +137,5 @@ U_BOOT_DRIVER(clk_sun50i_a64) = { .ofdata_to_platdata = a64_clk_ofdata_to_platdata, .ops = &a64_clk_ops, .probe = a64_clk_probe, + .bind = sunxi_clk_bind, };
drivers/clk/sunxi/clk_sunxi.c new file +39 -0
@@ -0,0 +1,39 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dm/lists.h> + +int sunxi_clk_bind (struct udevice *cdev) +{ +struct udevice *rst_dev; +char *dev_name ="reset" ; +char drv_name[30 ]; +int ret; + +/** +* reset driver doesn't have separate dt binding, so probe them +* using driver name. +* example: sun50i_a64_ccu is clock driver, +* sun50i_a64_reset is reset driver. +*/ +strcpy (drv_name, cdev->driver->name); +memcpy (&drv_name[strlen (drv_name) -3 ], dev_name,strlen (dev_name)); + + ret =device_bind_driver_to_node (cdev, drv_name, dev_name, +dev_ofnode (cdev), &rst_dev); +if (ret) { +debug ("Warning: failed to bind (%s) reset driver: ret=%d\n" , + drv_name, ret); +return ret; + } + +return 0 ; +}
Signature · 1 line
2.17.1
RFC 15/35 reset: Add default request ops
In reply to Jagan TekiMissing request ops from respective uclass driver generating "synchronous abort" in Allwinner platform, may be in arm. So add default request ops and give a chance to uclass driver to think whether they really need request or not.
--- drivers/reset/reset-uclass.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/reset/reset-uclass.c +9 -1
@@ -14,6 +14,11 @@ static inline struct reset_ops *reset_dev_ops(struct udevice *dev)return (struct reset_ops *)dev->driver->ops; } +static int reset_request_default (struct reset_ctl *reset_ctl) +{ +return 0 ; +} +static int reset_of_xlate_default (struct reset_ctl *reset_ctl,struct ofnode_phandle_args *args) {
@@ -69,7 +74,10 @@ int reset_get_by_index(struct udevice *dev, int index,return ret; } - ret = ops->request (reset_ctl); +if (ops->request) + ret = ops->request (reset_ctl); +else + ret =reset_request_default (reset_ctl);if (ret) {debug ("ops->request() failed: %d\n" , ret);return ret;
Signature · 1 line
2.17.1
RFC 16/35 reset: sunxi: a64: Implement USB resets
In reply to Jagan TekiImplement USB reset asser, deasset, request functions for OHCI, EHCI, OTG and USBPHY reset registers.
--- drivers/reset/sunxi/reset_a64.c | 60 +++++++++++++++++++++++++++++---- 1 file changed, 54 insertions(+), 6 deletions(-)
drivers/reset/sunxi/reset_a64.c +54 -6
@@ -20,6 +20,10 @@ static int a64_reset_request(struct reset_ctl *reset_ctl) {debug ("%s(#%ld)\n" , __func__, reset_ctl->id); +/* check dt-bindings/reset/sun50i-a64-ccu.h for max id */ +if (reset_ctl->id >50 ) +return -EINVAL ; +return 0 ; }
@@ -32,18 +36,58 @@ static int a64_reset_free(struct reset_ctl *reset_ctl)static int a64_reset_assert (struct reset_ctl *reset_ctl) { -debug ("%s(#%ld)\n" , __func__, reset_ctl->id); +struct a64_reset_priv *priv =dev_get_priv (reset_ctl->dev); -debug (" unhandled\n" ); -return -EINVAL ; +debug ("%s(#%ld)\n" , __func__, reset_ctl->id); +switch (reset_ctl->id) { +case RST_BUS_OTG : +case RST_BUS_EHCI0 : +case RST_BUS_EHCI1 : +clrbits_le32 (priv->base +0x2c0 , +BIT (23 + (reset_ctl->id -RST_BUS_OTG ))); +return 0 ; +case RST_BUS_OHCI0 : +case RST_BUS_OHCI1 : +clrbits_le32 (priv->base +0x2c0 , +BIT (28 + (reset_ctl->id -RST_BUS_OHCI0 ))); +return 0 ; +case RST_USB_PHY0 : +case RST_USB_PHY1 : +clrbits_le32 (priv->base +0x0cc , +BIT (reset_ctl->id -RST_USB_PHY0 )); +return 0 ; +default : +debug ("%s (RST#%ld) unhandled\n" , __func__, reset_ctl->id); +return -ENODEV ; + } }static int a64_reset_deassert (struct reset_ctl *reset_ctl) { -debug ("%s(#%ld)\n" , __func__, reset_ctl->id); +struct a64_reset_priv *priv =dev_get_priv (reset_ctl->dev); -debug (" unhandled\n" ); -return -EINVAL ; +debug ("%s(#%ld)\n" , __func__, reset_ctl->id); +switch (reset_ctl->id) { +case RST_BUS_OTG : +case RST_BUS_EHCI0 : +case RST_BUS_EHCI1 : +setbits_le32 (priv->base +0x2c0 , +BIT (23 + (reset_ctl->id -RST_BUS_OTG ))); +return 0 ; +case RST_BUS_OHCI0 : +case RST_BUS_OHCI1 : +setbits_le32 (priv->base +0x2c0 , +BIT (28 + (reset_ctl->id -RST_BUS_OHCI0 ))); +return 0 ; +case RST_USB_PHY0 : +case RST_USB_PHY1 : +setbits_le32 (priv->base +0x0cc , +BIT (reset_ctl->id -RST_USB_PHY0 )); +return 0 ; +default : +debug ("%s (RST#%ld) unhandled\n" , __func__, reset_ctl->id); +return -ENODEV ; + } }struct reset_ops a64_reset_ops = {
@@ -55,6 +99,10 @@ struct reset_ops a64_reset_ops = {static int a64_reset_probe (struct udevice *dev) { +struct a64_reset_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); +return 0 ; }
Signature · 1 line
2.17.1
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
In reply to Jagan TekiAdd initial clock driver Allwinner for H3_H5.
Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.c
drivers/clk/sunxi/Kconfig +7 -0
@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50I
drivers/clk/sunxi/Makefile +2 -0
@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_h3.c new file +131 -0
131 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
Quoted 169 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +121
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; +
drivers/clk/sunxi/clk_h3.c line 131
Quoted 10 lines
drivers/clk/sunxi/clk_h3.c new file +10
-0+U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe, + .bind = sunxi_clk_bind, +};
Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the set_rate / get_rate callbacks into the mix it's going to turn into a nightmare.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180716/4160e244/attachment.sig>
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,
Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.
I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?
But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
struct sunxi_clk_defs {
uint16_t clk_bus_usb_offset;
uint16_t clk_bus_usb_bit;
...
} sun8i_h3_h5_clk_defs = {
.clk_bus_usb_offset = 0x60;
.clk_bus_usb_bit = 23;
};
... case CLK_BUS_OHCI3:
clrbits_le32(priv->base + priv->clk_bus_usb_offset,
BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG)));
....
static const struct udevice_id sunxi_clk_ids[] = {
{ .compatible = "allwinner,sun8i-h3-ccu",
.data = sun8i_h3_h5_clk_defs },
};Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
int sunxi_clk_bus_usb_idx (struct sunxi_clk_defs *priv, int clkid)
{
if (clkid >= priv->first_bus_usb &&
clkid <= priv->last_bus_usb)
return clkid - priv->first_bus_usb;
return -1;
}
static int h3_clk_enable(struct clk *clk)
{
...
idx = sunxi_clk_bus_usb_idx(priv, clk->id));
if (idx >= 0)
setbits_le32(priv->base + 0x60, BIT(23 + idx));
idx = sunxi_clk_usb_phy_idx(priv, clk->id));
if (idx >= 0)
setbits_le32(priv->base + 0xcc, BIT(8 + idx));Cheers,
Andre.
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
Quoted 203 lines · Andre Przywara
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
Quoted 16 lines
struct sunxi_clk_defs {
uint16_t clk_bus_usb_offset;
uint16_t clk_bus_usb_bit;
...
} sun8i_h3_h5_clk_defs = {
.clk_bus_usb_offset = 0x60;
.clk_bus_usb_bit = 23;
};
... case CLK_BUS_OHCI3:
clrbits_le32(priv->base + priv->clk_bus_usb_offset,
BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG)));
....
static const struct udevice_id sunxi_clk_ids[] = {
{ .compatible = "allwinner,sun8i-h3-ccu",
.data = sun8i_h3_h5_clk_defs },
};I tried this boilerplates via driver data, this would ended-ed big structure for all SoC's and afraid to move further since we have other IP's to add in future. may be in separate file for each IP not sure.
Quoted 6 lines
Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
intsunxi_clk_bus_usb_idx(structsunxi_clk_defs*priv, int clkid)
Quoted 12 lines
{
if (clkid >= priv->first_bus_usb &&
clkid <= priv->last_bus_usb)
return clkid - priv->first_bus_usb;
return -1;
}
static int h3_clk_enable(struct clk *clk)
{
...
idx = sunxi_clk_bus_usb_idx(priv, clk->id));
if (idx >= 0)
setbits_le32(priv->base + 0x60, BIT(23 + idx));This look interesting, but the issue with bit positions are different between SoC's even we have bit position change between EHCI to OHCI clk_bus like this
case CLK_AHB1_OTG:
setbits_le32(priv->base + 0x60, BIT(24));
return 0;
case CLK_AHB1_EHCI0:
case CLK_AHB1_EHCI1:
setbits_le32(priv->base + 0x60, BIT(26 + (clk->id - CLK_AHB1_EHCI0))); return 0;
case CLK_AHB1_OHCI0:
case CLK_AHB1_OHCI1:
case CLK_AHB1_OHCI2:
setbits_le32(priv->base + 0x60, BIT(29 + (clk->id - CLK_AHB1_OHCI0)));
On the other-side, may be we can think of common implementation for set/get_rate instead of bit enable/disable because bit enable/disable need many IP's than rate by keeping enable code simple.
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
In reply to Andre PrzywaraQuoted 225 lines · Andre Przywara
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
struct sunxi_clk_defs { uint16_t clk_bus_usb_offset; uint16_t clk_bus_usb_bit; ... } sun8i_h3_h5_clk_defs = { .clk_bus_usb_offset = 0x60; .clk_bus_usb_bit = 23; }; ... case CLK_BUS_OHCI3: clrbits_le32(priv->base + priv->clk_bus_usb_offset, BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG))); .... static const struct udevice_id sunxi_clk_ids[] = { { .compatible = "allwinner,sun8i-h3-ccu", .data = sun8i_h3_h5_clk_defs }, };Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
intsunxi_clk_bus_usb_idx(structsunxi_clk_defs*priv, int clkid)
Quoted 15 lines
{
if (clkid >= priv->first_bus_usb &&
clkid <= priv->last_bus_usb)
return clkid - priv->first_bus_usb;
return -1;
}
static int h3_clk_enable(struct clk *clk)
{
...
idx = sunxi_clk_bus_usb_idx(priv, clk->id));
if (idx >= 0)
setbits_le32(priv->base + 0x60, BIT(23 + idx));
idx = sunxi_clk_usb_phy_idx(priv, clk->id));
if (idx >= 0)
setbits_le32(priv->base + 0xcc, BIT(8 + idx));I guess we could also give to a common code a key / value (register - offset) pair that would be SoC specific, a simpler version of what we're doing in Linux.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180717/a8688466/attachment.sig>
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
Hi,
Quoted 242 lines · Maxime Ripard
Quoted 225 lines · Andre Przywara
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
struct sunxi_clk_defs { uint16_t clk_bus_usb_offset; uint16_t clk_bus_usb_bit; ... } sun8i_h3_h5_clk_defs = { .clk_bus_usb_offset = 0x60; .clk_bus_usb_bit = 23; }; ... case CLK_BUS_OHCI3: clrbits_le32(priv->base + priv->clk_bus_usb_offset, BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG))); .... static const struct udevice_id sunxi_clk_ids[] = { { .compatible = "allwinner,sun8i-h3-ccu", .data = sun8i_h3_h5_clk_defs }, };Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
intsunxi_clk_bus_usb_idx(structsunxi_clk_defs*priv, int clkid)Quoted 15 lines
{ if (clkid >= priv->first_bus_usb && clkid <= priv->last_bus_usb) return clkid - priv->first_bus_usb; return -1; } static int h3_clk_enable(struct clk *clk) { ... idx = sunxi_clk_bus_usb_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0x60, BIT(23 + idx)); idx = sunxi_clk_usb_phy_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0xcc, BIT(8 + idx));
Quoted 3 lines
I guess we could also give to a common code a key / value (register - offset) pair that would be SoC specific, a simpler version of what we're doing in Linux.
Yeah, something like that.
I wonder if it would be useful to implement *two* clocks (USB and MMC or UART) for *two* SoCs, to get a feeling what would be useful and feasible. Definitely having one clock for *all* SoCs (like here) might be a lot of work to potentially throw away, and might not reveal everything we need.
Cheers,
Andre.
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
Quoted 249 lines · Andre Przywara
Hi,
Quoted 242 lines · Maxime Ripard
Quoted 225 lines · Andre Przywara
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
struct sunxi_clk_defs { uint16_t clk_bus_usb_offset; uint16_t clk_bus_usb_bit; ... } sun8i_h3_h5_clk_defs = { .clk_bus_usb_offset = 0x60; .clk_bus_usb_bit = 23; }; ... case CLK_BUS_OHCI3: clrbits_le32(priv->base + priv->clk_bus_usb_offset, BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG))); .... static const struct udevice_id sunxi_clk_ids[] = { { .compatible = "allwinner,sun8i-h3-ccu", .data = sun8i_h3_h5_clk_defs }, };Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
intsunxi_clk_bus_usb_idx(structsunxi_clk_defs*priv, int clkid)Quoted 15 lines
{ if (clkid >= priv->first_bus_usb && clkid <= priv->last_bus_usb) return clkid - priv->first_bus_usb; return -1; } static int h3_clk_enable(struct clk *clk) { ... idx = sunxi_clk_bus_usb_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0x60, BIT(23 + idx)); idx = sunxi_clk_usb_phy_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0xcc, BIT(8 + idx));Quoted 3 lines
I guess we could also give to a common code a key / value (register - offset) pair that would be SoC specific, a simpler version of what we're doing in Linux.
Quoted 6 lines
Yeah, something like that.
I wonder if it would be useful to implement *two* clocks (USB and MMC or UART) for *two* SoCs, to get a feeling what would be useful and feasible. Definitely having one clock for *all* SoCs (like here) might be a lot of work to potentially throw away, and might not reveal everything we need.
That definitely makes sense yes.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180717/c68a88a5/attachment.sig>
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
In reply to Maxime RipardQuoted 242 lines · Maxime Ripard
Quoted 225 lines · Andre Przywara
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
struct sunxi_clk_defs { uint16_t clk_bus_usb_offset; uint16_t clk_bus_usb_bit; ... } sun8i_h3_h5_clk_defs = { .clk_bus_usb_offset = 0x60; .clk_bus_usb_bit = 23; }; ... case CLK_BUS_OHCI3: clrbits_le32(priv->base + priv->clk_bus_usb_offset, BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG))); .... static const struct udevice_id sunxi_clk_ids[] = { { .compatible = "allwinner,sun8i-h3-ccu", .data = sun8i_h3_h5_clk_defs }, };Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
intsunxi_clk_bus_usb_idx(structsunxi_clk_defs*priv, int clkid)Quoted 15 lines
{ if (clkid >= priv->first_bus_usb && clkid <= priv->last_bus_usb) return clkid - priv->first_bus_usb; return -1; } static int h3_clk_enable(struct clk *clk) { ... idx = sunxi_clk_bus_usb_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0x60, BIT(23 + idx)); idx = sunxi_clk_usb_phy_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0xcc, BIT(8 + idx));
Quoted 3 lines
I guess we could also give to a common code a key / value (register - offset) pair that would be SoC specific, a simpler version of what we're doing in Linux.
is it something like ccu_reset_map struct with reg and bit members?
[RST_USB_PHY0] = { 0x0cc, BIT(0) },
RFC 17/35 clk: sunxi: Add initial CLK driver for H3_H5
Quoted 244 lines · Jagan Teki
Quoted 242 lines · Maxime Ripard
Quoted 240 lines · Andre Przywara
Hi,
Quoted 178 lines · Maxime Ripard
Quoted 177 lines · Jagan Teki
Add initial clock driver Allwinner for
H3_H5.Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
Signed-off-by Jagan Teki <[email protected]>--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 2 + drivers/clk/sunxi/clk_h3.c | 131 +++++++++++++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 drivers/clk/sunxi/clk_h3.cdrivers/clk/sunxi/Kconfig +7
-0@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN8I_H3 + bool "Clock driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common clock driver support for platforms based + on Allwinner H3/H5 SoC. + config CLK_SUN50I_A64 bool "Clock driver for Allwinner A64" default MACH_SUN50Idrivers/clk/sunxi/Makefile +2
-0@@ -5,4 +5,6 @@ # obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o + +obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.odrivers/clk/sunxi/clk_h3.c new file +129
-0@@ -0,0 +1,131 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* +* Copyright (C) 2018 Amarula Solutions B.V. +* Author: Jagan Teki <[email protected]> +*/ + +#include <common.h> +#include <clk-uclass.h> +#include <dm.h> +#include <errno.h> +#include <asm/io.h> +#include <asm/arch/clock.h> +#include <dt-bindings/clock/sun8i-h3-ccu.h> + +struct h3_clk_priv { +void *base; +}; + +static int h3_clk_enable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +setbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +setbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +setbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static int h3_clk_disable (struct clk *clk) +{ +struct h3_clk_priv *priv =dev_get_priv (clk->dev); + +debug ("%s(#%ld)\n" , __func__, clk->id); + +switch (clk->id) { +case CLK_BUS_OTG : +case CLK_BUS_EHCI0 : +case CLK_BUS_EHCI1 : +case CLK_BUS_EHCI2 : +case CLK_BUS_EHCI3 : +case CLK_BUS_OHCI0 : +case CLK_BUS_OHCI1 : +case CLK_BUS_OHCI2 : +case CLK_BUS_OHCI3 : +clrbits_le32 (priv->base +0x60 , +BIT (23 + (clk->id -CLK_BUS_OTG ))); +return 0 ; +case CLK_USB_PHY0 : +case CLK_USB_PHY1 : +case CLK_USB_PHY2 : +case CLK_USB_PHY3 : +clrbits_le32 (priv->base +0xcc , +BIT (8 + (clk->id -CLK_USB_PHY0 ))); +return 0 ; +case CLK_USB_OHCI0 : +case CLK_USB_OHCI1 : +case CLK_USB_OHCI2 : +case CLK_USB_OHCI3 : +clrbits_le32 (priv->base +0xcc , +BIT (16 + (clk->id -CLK_USB_OHCI0 ))); +return 0 ; +default : +debug ("%s (CLK#%ld) unhandled\n" , __func__, clk->id); +return -ENODEV ; + } +} + +static struct clk_ops h3_clk_ops = { + .enable = h3_clk_enable, + .disable = h3_clk_disable, +}; + +static int h3_clk_probe (struct udevice *dev) +{ +return 0 ; +} + +static int h3_clk_ofdata_to_platdata (struct udevice *dev) +{ +struct h3_clk_priv *priv =dev_get_priv (dev); + + priv->base =dev_read_addr_ptr (dev); + +return 0 ; +} + +static const struct udevice_id h3_clk_ids[] = { + { .compatible ="allwinner,sun8i-h3-ccu" }, + { .compatible ="allwinner,sun50i-h5-ccu" }, + { } +}; + +U_BOOT_DRIVER (clk_sun8i_h3) = { + .name ="sun8i_h3_ccu" , + .id =UCLASS_CLK , + .of_match = h3_clk_ids, + .priv_auto_alloc_size =sizeof (struct h3_clk_priv ), + .ofdata_to_platdata = h3_clk_ofdata_to_platdata, + .ops = &h3_clk_ops, + .probe = h3_clk_probe,Quoted 8 lines
drivers/clk/sunxi/clk_h3.c line 131
Quoted 2 lines
drivers/clk/sunxi/clk_h3.c new file +2
-0+ .bind = sunxi_clk_bind, +};Speaking from experience, you do not want to have separate implementations for each and every SoCs. This might be enough for enabling / disabling the clocks, but as soon as you'll throw the
set_rate/get_ratecallbacks into the mix it's going to turn into a nightmare.I agree, but I guess it won't be too pretty anyway:
The CLK_BUS_[EO]HCIx definitions are different for each SoC, but share the same symbol. So we can't use a nicely readable switch/case anymore. Unless we translate the values to a common namespace?But I support that we should share as much code as possible, maybe by using macros to instantiate the driver boilerplates and by using a shared file with the gist of the clock programming code and then just have shim layers to connect the bits?
In case it's just bit and register offsets differing, we could define a structure holding register and bit offsets, filling this for the various SoCs, then tie those together with the compatible strings:
struct sunxi_clk_defs { uint16_t clk_bus_usb_offset; uint16_t clk_bus_usb_bit; ... } sun8i_h3_h5_clk_defs = { .clk_bus_usb_offset = 0x60; .clk_bus_usb_bit = 23; }; ... case CLK_BUS_OHCI3: clrbits_le32(priv->base + priv->clk_bus_usb_offset, BIT(priv->clk_bus_usb_bit + (clk->id - CLK_BUS_OTG))); .... static const struct udevice_id sunxi_clk_ids[] = { { .compatible = "allwinner,sun8i-h3-ccu", .data = sun8i_h3_h5_clk_defs }, };Just an example, not sure we are actually much different in those bits there.
Or we put the DT clock numbers into that struct and look those up:
intsunxi_clk_bus_usb_idx(structsunxi_clk_defs*priv, int clkid){ if (clkid >= priv->first_bus_usb && clkid <= priv->last_bus_usb) return clkid - priv->first_bus_usb; return -1; } static int h3_clk_enable(struct clk *clk) { ... idx = sunxi_clk_bus_usb_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0x60, BIT(23 + idx)); idx = sunxi_clk_usb_phy_idx(priv, clk->id)); if (idx >= 0) setbits_le32(priv->base + 0xcc, BIT(8 + idx));
Quoted 6 lines
Quoted 3 lines
I guess we could also give to a common code a key / value (register - offset) pair that would be SoC specific, a simpler version of what we're doing in Linux.
is it something like
ccu_reset_mapstruct with reg and bit members?
[RST_USB_PHY0] = {0x0cc, BIT(0) },
Yes, something along those lines.
Maxime
Signature · 10 lines
Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180718/0deda18d/attachment.sig>
RFC 18/35 reset: sunxi: Add initial RESET driver for H3_H5
In reply to Jagan TekiAdd initial reset driver for Allwinner H3_H5.
Implement reset deassert and assert functions for USB OHCI, EHCI, OTG and PHY bus reset and clock registers.
--- drivers/reset/sunxi/Kconfig | 7 ++ drivers/reset/sunxi/Makefile | 1 + drivers/reset/sunxi/reset_h3.c | 121 +++++++++++++++++++++++++++++++++ 3 files changed, 129 insertions(+) create mode 100644 drivers/reset/sunxi/reset_h3.c
drivers/reset/sunxi/Kconfig +7 -0
@@ -9,6 +9,13 @@ config RESET_SUNXI if RESET_SUNXI +config RESET_SUN8I_H3 + bool "Reset driver for Allwinner H3/H5" + default MACH_SUNXI_H3_H5 + help + This enables common reset driver support for platforms based + on Allwinner H3/H5 SoC. + config RESET_SUN50I_A64 bool "Reset driver for Allwinner A64" default MACH_SUN50I
drivers/reset/sunxi/Makefile +1 -0
@@ -4,4 +4,5 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-$(CONFIG_RESET_SUN8I_H3) += reset_h3.o obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_h3.c new file +121 -0
121 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 19/35 clk: sunxi: Add initial CLK driver for A10/A20
In reply to Jagan TekiAdd initial clock driver Allwinner for A10/A20.
Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
--- drivers/clk/sunxi/Kconfig | 7 +++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk_a10.c | 105 ++++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 drivers/clk/sunxi/clk_a10.c
drivers/clk/sunxi/Kconfig +7 -0
@@ -8,6 +8,13 @@ config CLK_SUNXI if CLK_SUNXI +config CLK_SUN4I_A10 + bool "Clock driver for Allwinner A10/A20" + default MACH_SUN4I || MACH_SUN7I + help + This enables common clock driver support for platforms based + on Allwinner A10/A20 SoC. + config CLK_SUN8I_H3 bool "Clock driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/clk/sunxi/Makefile +1 -0
@@ -6,5 +6,6 @@ obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o +obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_a10.c new file +105 -0
105 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 20/35 reset: sunxi: Add initial RESET driver for A10/A20
In reply to Jagan TekiAdd initial reset driver for Allwinner A10/A20.
Implement reset deassert and assert functions for USB OHCI, EHCI, OTG and PHY bus reset and clock registers.
--- drivers/reset/sunxi/Kconfig | 7 +++ drivers/reset/sunxi/Makefile | 1 + drivers/reset/sunxi/reset_a10.c | 95 +++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 drivers/reset/sunxi/reset_a10.c
drivers/reset/sunxi/Kconfig +7 -0
@@ -9,6 +9,13 @@ config RESET_SUNXI if RESET_SUNXI +config RESET_SUN4I_A10 + bool "Reset driver for Allwinner A10/A20" + default MACH_SUN4I || MACH_SUN7I + help + This enables common reset driver support for platforms based + on Allwinner A10/A20 SoC. + config RESET_SUN8I_H3 bool "Reset driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/reset/sunxi/Makefile +1 -0
@@ -4,5 +4,6 @@ # SPDX-License-Identifier: GPL-2.0+ # +obj-$(CONFIG_RESET_SUN4I_A10) += reset_a10.o obj-$(CONFIG_RESET_SUN8I_H3) += reset_h3.o obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_a10.c new file +95 -0
95 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 21/35 clk: sunxi: Add initial CLK driver for A10s/A13
In reply to Jagan TekiAdd initial clock driver Allwinner for A10s/A13.
Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
--- drivers/clk/sunxi/Kconfig | 7 +++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk_a10s.c | 105 +++++++++++++++++++++++++++++++++++ 3 files changed, 113 insertions(+) create mode 100644 drivers/clk/sunxi/clk_a10s.c
drivers/clk/sunxi/Kconfig +7 -0
@@ -15,6 +15,13 @@ config CLK_SUN4I_A10 This enables common clock driver support for platforms based on Allwinner A10/A20 SoC. +config CLK_SUN5I_A10S + bool "Clock driver for Allwinner A10s/A13" + default MACH_SUN5I + help + This enables common clock driver support for platforms based + on Allwinner A10s/A13 SoC. + config CLK_SUN8I_H3 bool "Clock driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/clk/sunxi/Makefile +1 -0
@@ -7,5 +7,6 @@ obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o +obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_a10s.c new file +105 -0
105 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 22/35 reset: sunxi: Add initial RESET driver for A10s/A13
In reply to Jagan TekiAdd initial reset driver for Allwinner A10s/A13.
Implement reset deassert and assert functions for USB OHCI, EHCI, OTG and PHY bus reset and clock registers.
--- drivers/reset/sunxi/Kconfig | 7 +++ drivers/reset/sunxi/Makefile | 1 + drivers/reset/sunxi/reset_a10s.c | 93 ++++++++++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 drivers/reset/sunxi/reset_a10s.c
drivers/reset/sunxi/Kconfig +7 -0
@@ -16,6 +16,13 @@ config RESET_SUN4I_A10 This enables common reset driver support for platforms based on Allwinner A10/A20 SoC. +config RESET_SUN5I_A10S + bool "Reset driver for Allwinner A10s/A13" + default MACH_SUN5I + help + This enables common reset driver support for platforms based + on Allwinner A10s/A13 SoC. + config RESET_SUN8I_H3 bool "Reset driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/reset/sunxi/Makefile +1 -0
@@ -5,5 +5,6 @@ # obj-$(CONFIG_RESET_SUN4I_A10) += reset_a10.o +obj-$(CONFIG_RESET_SUN5I_A10S) += reset_a10s.o obj-$(CONFIG_RESET_SUN8I_H3) += reset_h3.o obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_a10s.c new file +93 -0
93 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 23/35 clk: sunxi: Add initial CLK driver for A31/A31s
In reply to Jagan TekiAdd initial clock driver Allwinner for A31/A31s.
Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk_a31.c | 130 ++++++++++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 drivers/clk/sunxi/clk_a31.c
drivers/clk/sunxi/Kconfig +7 -0
@@ -22,6 +22,13 @@ config CLK_SUN5I_A10S This enables common clock driver support for platforms based on Allwinner A10s/A13 SoC. +config CLK_SUN6I_A31 + bool "Clock driver for Allwinner A31/A31s" + default MACH_SUN6I + help + This enables common clock driver support for platforms based + on Allwinner A31/A31s SoC. + config CLK_SUN8I_H3 bool "Clock driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/clk/sunxi/Makefile +1 -0
@@ -8,5 +8,6 @@ obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o +obj-$(CONFIG_CLK_SUN6I_A31) += clk_a31.o obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_a31.c new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 24/35 reset: sunxi: Add initial RESET driver for A31/A31s
In reply to Jagan TekiAdd initial reset driver for Allwinner A31/A31s.
Implement reset deassert and assert functions for USB OHCI, EHCI, OTG and PHY bus reset and clock registers.
--- drivers/reset/sunxi/Kconfig | 7 ++ drivers/reset/sunxi/Makefile | 1 + drivers/reset/sunxi/reset_a31.c | 123 ++++++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 drivers/reset/sunxi/reset_a31.c
drivers/reset/sunxi/Kconfig +7 -0
@@ -23,6 +23,13 @@ config RESET_SUN5I_A10S This enables common reset driver support for platforms based on Allwinner A10s/A13 SoC. +config RESET_SUN6I_A31 + bool "Reset driver for Allwinner A31/A31s" + default MACH_SUN6I + help + This enables common reset driver support for platforms based + on Allwinner A31/A31s SoC. + config RESET_SUN8I_H3 bool "Reset driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/reset/sunxi/Makefile +1 -0
@@ -6,5 +6,6 @@ obj-$(CONFIG_RESET_SUN4I_A10) += reset_a10.o obj-$(CONFIG_RESET_SUN5I_A10S) += reset_a10s.o +obj-$(CONFIG_RESET_SUN6I_A31) += reset_a31.o obj-$(CONFIG_RESET_SUN8I_H3) += reset_h3.o obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_a31.c new file +123 -0
123 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 25/35 clk: sunxi: Add initial CLK driver for A23
In reply to Jagan TekiAdd initial clock driver Allwinner A23.
Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
--- drivers/clk/sunxi/Kconfig | 7 +++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk_a23.c | 112 ++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 drivers/clk/sunxi/clk_a23.c
drivers/clk/sunxi/Kconfig +7 -0
@@ -29,6 +29,13 @@ config CLK_SUN6I_A31 This enables common clock driver support for platforms based on Allwinner A31/A31s SoC. +config CLK_SUN8I_A23 + bool "Clock driver for Allwinner A23" + default MACH_SUN8I_A23 + help + This enables common clock driver support for platforms based + on Allwinner A23 SoC. + config CLK_SUN8I_H3 bool "Clock driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/clk/sunxi/Makefile +1 -0
@@ -9,5 +9,6 @@ obj-$(CONFIG_CLK_SUNXI) += clk_sunxi.o obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o obj-$(CONFIG_CLK_SUN6I_A31) += clk_a31.o +obj-$(CONFIG_CLK_SUN8I_A23) += clk_a23.o obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_a23.c new file +112 -0
112 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 26/35 reset: sunxi: Add initial RESET driver for A23
In reply to Jagan TekiAdd initial reset driver Allwinner A23.
Implemented reset deassert and assert functions for USB OHCI, EHCI, OTG and PHY bus reset and clock registers.
--- drivers/reset/sunxi/Kconfig | 7 ++ drivers/reset/sunxi/Makefile | 1 + drivers/reset/sunxi/reset_a23.c | 111 ++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 drivers/reset/sunxi/reset_a23.c
drivers/reset/sunxi/Kconfig +7 -0
@@ -30,6 +30,13 @@ config RESET_SUN6I_A31 This enables common reset driver support for platforms based on Allwinner A31/A31s SoC. +config RESET_SUN8I_A23 + bool "Reset driver for Allwinner A23" + default MACH_SUN8I_A23 + help + This enables common reset driver support for platforms based + on Allwinner A23 SoC. + config RESET_SUN8I_H3 bool "Reset driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/reset/sunxi/Makefile +1 -0
@@ -7,5 +7,6 @@ obj-$(CONFIG_RESET_SUN4I_A10) += reset_a10.o obj-$(CONFIG_RESET_SUN5I_A10S) += reset_a10s.o obj-$(CONFIG_RESET_SUN6I_A31) += reset_a31.o +obj-$(CONFIG_RESET_SUN8I_A23) += reset_a23.o obj-$(CONFIG_RESET_SUN8I_H3) += reset_h3.o obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_a23.c new file +111 -0
111 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 27/35 clk: sunxi: a23: Add CLK support for A33
In reply to Jagan TekiA33 has separate clock driver in Linux because of few clock differences wrt to A23 like audio etc,. these may not useful for U-Boot so added a33 ccu compatible on existing a23 clock driver.
--- drivers/clk/sunxi/Kconfig | 6 +++--- drivers/clk/sunxi/clk_a23.c | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/clk/sunxi/Kconfig +3 -3
@@ -30,11 +30,11 @@ config CLK_SUN6I_A31 on Allwinner A31/A31s SoC. config CLK_SUN8I_A23 - bool "Clock driver for Allwinner A23" - default MACH_SUN8I_A23 + bool "Clock driver for Allwinner A23/A33" + default MACH_SUN8I_A23 || MACH_SUN8I_A33 help This enables common clock driver support for platforms based - on Allwinner A23 SoC. + on Allwinner A23/A33 SoC. config CLK_SUN8I_H3 bool "Clock driver for Allwinner H3/H5"
drivers/clk/sunxi/clk_a23.c +1 -0
@@ -97,6 +97,7 @@ static int a23_clk_ofdata_to_platdata(struct udevice *dev)static const struct udevice_id a23_clk_ids[] = { { .compatible ="allwinner,sun8i-a23-ccu" }, + { .compatible ="allwinner,sun8i-a33-ccu" }, { } };
Signature · 1 line
2.17.1
RFC 28/35 reset: sunxi: a23: Add RESET support A33
In reply to Jagan TekiLike CLK support is handling via A23 driver, even RESET can handle in similar way. So enable reset_a23 for A33 as well.
--- drivers/reset/sunxi/Kconfig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/reset/sunxi/Kconfig +3 -3
@@ -31,11 +31,11 @@ config RESET_SUN6I_A31 on Allwinner A31/A31s SoC. config RESET_SUN8I_A23 - bool "Reset driver for Allwinner A23" - default MACH_SUN8I_A23 + bool "Reset driver for Allwinner A23/A33" + default MACH_SUN8I_A23 || MACH_SUN8I_A33 help This enables common reset driver support for platforms based - on Allwinner A23 SoC. + on Allwinner A23/A33 SoC. config RESET_SUN8I_H3 bool "Reset driver for Allwinner H3/H5"
Signature · 1 line
2.17.1
RFC 29/35 clk: sunxi: Add initial CLK driver for A83T
In reply to Jagan TekiAdd initial clock driver Allwinner A83T.
Implemented clock enable and disable functions for USB OHCI, EHCI, OTG and PHY gate and clock registers.
--- drivers/clk/sunxi/Kconfig | 7 ++ drivers/clk/sunxi/Makefile | 1 + drivers/clk/sunxi/clk_a83t.c | 120 +++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 drivers/clk/sunxi/clk_a83t.c
drivers/clk/sunxi/Kconfig +7 -0
@@ -36,6 +36,13 @@ config CLK_SUN8I_A23 This enables common clock driver support for platforms based on Allwinner A23/A33 SoC. +config CLK_SUN8I_A83T + bool "Clock driver for Allwinner A83T" + default MACH_SUN8I_A83T + help + This enables common clock driver support for platforms based + on Allwinner A83T SoC. + config CLK_SUN8I_H3 bool "Clock driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/clk/sunxi/Makefile +1 -0
@@ -10,5 +10,6 @@ obj-$(CONFIG_CLK_SUN4I_A10) += clk_a10.o obj-$(CONFIG_CLK_SUN5I_A10S) += clk_a10s.o obj-$(CONFIG_CLK_SUN6I_A31) += clk_a31.o obj-$(CONFIG_CLK_SUN8I_A23) += clk_a23.o +obj-$(CONFIG_CLK_SUN8I_A83T) += clk_a83t.o obj-$(CONFIG_CLK_SUN8I_H3) += clk_h3.o obj-$(CONFIG_CLK_SUN50I_A64) += clk_a64.o
drivers/clk/sunxi/clk_a83t.c new file +120 -0
120 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 30/35 reset: sunxi: Add initial RESET driver for A83T
In reply to Jagan TekiAdd initial reset driver for Allwinner A83T.
Implement reset deassert and assert functions for USB OHCI, EHCI, OTG and PHY bus reset and clock registers.
--- drivers/reset/sunxi/Kconfig | 7 ++ drivers/reset/sunxi/Makefile | 1 + drivers/reset/sunxi/reset_a83t.c | 117 +++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 drivers/reset/sunxi/reset_a83t.c
drivers/reset/sunxi/Kconfig +7 -0
@@ -37,6 +37,13 @@ config RESET_SUN8I_A23 This enables common reset driver support for platforms based on Allwinner A23/A33 SoC. +config RESET_SUN8I_A83T + bool "Reset driver for Allwinner A83T" + default MACH_SUN8I_A83T + help + This enables common reset driver support for platforms based + on Allwinner A83T SoC. + config RESET_SUN8I_H3 bool "Reset driver for Allwinner H3/H5" default MACH_SUNXI_H3_H5
drivers/reset/sunxi/Makefile +1 -0
@@ -8,5 +8,6 @@ obj-$(CONFIG_RESET_SUN4I_A10) += reset_a10.o obj-$(CONFIG_RESET_SUN5I_A10S) += reset_a10s.o obj-$(CONFIG_RESET_SUN6I_A31) += reset_a31.o obj-$(CONFIG_RESET_SUN8I_A23) += reset_a23.o +obj-$(CONFIG_RESET_SUN8I_A83T) += reset_a83t.o obj-$(CONFIG_RESET_SUN8I_H3) += reset_h3.o obj-$(CONFIG_RESET_SUN50I_A64) += reset_a64.o
drivers/reset/sunxi/reset_a83t.c new file +117 -0
117 lines not on this page · raw message
Signature · 1 line
2.17.1
RFC 31/35 sunxi: Enable CLK and RESET
In reply to Jagan TekiCLK and RESET drivers are now available for most of the Allwinner platforms, so enable in mach-sunxi/Kconfig
--- arch/arm/mach-sunxi/Kconfig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
arch/arm/mach-sunxi/Kconfig +18 -0
@@ -126,6 +126,8 @@ endif config MACH_SUNXI_H3_H5 bool + select CLK_SUNXI + select RESET_SUNXI select DM_I2C select DM_MMC if MMC select PHY_SUN4I_USB
@@ -142,6 +144,8 @@ choice config MACH_SUN4I bool "sun4i (Allwinner A10)" select CPU_V7A + select CLK_SUNXI + select RESET_SUNXI select ARM_CORTEX_CPU_IS_UP select DM_MMC if MMC select DM_SCSI if SCSI
@@ -153,6 +157,8 @@ config MACH_SUN4I config MACH_SUN5I bool "sun5i (Allwinner A13)" select CPU_V7A + select CLK_SUNXI + select RESET_SUNXI select ARM_CORTEX_CPU_IS_UP select DRAM_SUN4I select DM_MMC if MMC
@@ -167,6 +173,8 @@ config MACH_SUN6I select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT select ARCH_SUPPORT_PSCI + select CLK_SUNXI + select RESET_SUNXI select DRAM_SUN6I select DM_MMC if MMC select PHY_SUN4I_USB
@@ -182,6 +190,8 @@ config MACH_SUN7I select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT select ARCH_SUPPORT_PSCI + select CLK_SUNXI + select RESET_SUNXI select DRAM_SUN4I select DM_MMC if MMC select PHY_SUN4I_USB
@@ -195,6 +205,8 @@ config MACH_SUN8I_A23 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT select ARCH_SUPPORT_PSCI + select CLK_SUNXI + select RESET_SUNXI select DRAM_SUN8I_A23 select DM_MMC if MMC select PHY_SUN4I_USB
@@ -209,6 +221,8 @@ config MACH_SUN8I_A33 select CPU_V7_HAS_NONSEC select CPU_V7_HAS_VIRT select ARCH_SUPPORT_PSCI + select CLK_SUNXI + select RESET_SUNXI select DRAM_SUN8I_A33 select DM_MMC if MMC select PHY_SUN4I_USB
@@ -221,6 +235,8 @@ config MACH_SUN8I_A83T bool "sun8i (Allwinner A83T)" select CPU_V7A select DM_MMC if MMC + select CLK_SUNXI + select RESET_SUNXI select DRAM_SUN8I_A83T select PHY_SUN4I_USB select SUNXI_GEN_SUN6I
@@ -276,6 +292,8 @@ config MACH_SUN50I select ARM64 select DM_I2C select DM_MMC if MMC + select CLK_SUNXI + select RESET_SUNXI select PHY_SUN4I_USB select SUNXI_DE2 select SUNXI_GEN_SUN6I
Signature · 1 line
2.17.1
RFC 32/35 musb-new: sunxi: Use CLK and RESET support
In reply to Jagan TekiNow clock and reset drivers are available for respective SoC's so use clk and reset ops on musb driver.
--- drivers/usb/musb-new/sunxi.c | 82 +++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 29 deletions(-)
drivers/usb/musb-new/sunxi.c +53 -29
@@ -16,9 +16,11 @@* This file is part of the Inventra Controller Driver for Linux. */ #include <common.h> +#include <clk.h> #include <dm.h> #include <generic-phy.h> #include <phy-sun4i-usb.h> +#include <reset.h> #include <asm/arch/cpu.h> #include <asm/arch/clock.h> #include <asm/arch/gpio.h>
@@ -78,16 +80,15 @@struct sunxi_musb_config {struct musb_hdrc_config *config; -u8 rst_bit; -u8 clkgate_bit; };struct sunxi_glue {struct musb_host_data mdata; -struct sunxi_ccm_reg *ccm;struct sunxi_musb_config *cfg;struct device dev;struct phy phy; +struct clk clocks; +struct reset_ctl resets; };#define to_sunxi_glue (d) container_of(d, struct sunxi_glue, dev)
@@ -291,6 +292,18 @@ static int sunxi_musb_init(struct musb *musb)pr_debug ("%s():\n" , __func__); + ret =clk_enable (&glue->clocks); +if (ret) { +dev_err (dev,"failed to enable clock\n" ); +return ret; + } + + ret =reset_deassert (&glue->resets); +if (ret) { +dev_err (dev,"failed to deassert reset\n" ); +return ret; + } + ret =generic_phy_init (&glue->phy);if (ret) {pr_err ("failed to init USB PHY\n" );
@@ -299,17 +312,6 @@ static int sunxi_musb_init(struct musb *musb) musb->isr = sunxi_musb_interrupt; -setbits_le32 (&glue->ccm->ahb_gate0,BIT (AHB_GATE_OFFSET_USB0 )); -if (glue->cfg->clkgate_bit) -setbits_le32 (&glue->ccm->ahb_gate0, -BIT (glue->cfg->clkgate_bit)); -#ifdef CONFIG_SUNXI_GEN_SUN6I -setbits_le32 (&glue->ccm->ahb_reset0_cfg,BIT (AHB_GATE_OFFSET_USB0 )); -if (glue->cfg->rst_bit) -setbits_le32 (&glue->ccm->ahb_reset0_cfg, -BIT (glue->cfg->rst_bit)); -#endif -USBC_ConfigFIFO_Base ();USBC_EnableDpDmPullUp (musb->mregs);USBC_EnableIdPullUp (musb->mregs);
@@ -339,16 +341,17 @@ static int sunxi_musb_exit(struct musb *musb) } } -#ifdef CONFIG_SUNXI_GEN_SUN6I -clrbits_le32 (&glue->ccm->ahb_reset0_cfg,BIT (AHB_GATE_OFFSET_USB0 )); -if (glue->cfg->rst_bit) -clrbits_le32 (&glue->ccm->ahb_reset0_cfg, -BIT (glue->cfg->rst_bit)); -#endif -clrbits_le32 (&glue->ccm->ahb_gate0,BIT (AHB_GATE_OFFSET_USB0 )); -if (glue->cfg->clkgate_bit) -clrbits_le32 (&glue->ccm->ahb_gate0, -BIT (glue->cfg->clkgate_bit)); + ret =reset_assert (&glue->resets); +if (ret) { +dev_err (dev,"failed to deassert reset\n" ); +return ret; + } + + ret =clk_disable (&glue->clocks); +if (ret) { +dev_err (dev,"failed to enable clock\n" ); +return ret; + }return 0 ; }
@@ -433,6 +436,7 @@ static int musb_usb_probe(struct udevice *dev)struct usb_bus_priv *priv =dev_get_uclass_priv (dev);struct musb_hdrc_platform_data pdata;void *base =dev_read_addr_ptr (dev); +int clock_nb, reset_nb;int ret;if (!base)
@@ -442,9 +446,31 @@ static int musb_usb_probe(struct udevice *dev)if (!glue->cfg)return -EINVAL ; - glue->ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE ; -if (IS_ERR (glue->ccm)) -return PTR_ERR (glue->ccm); + clock_nb =ofnode_count_phandle_with_args (dev_ofnode (dev),"clocks" , +"#clock-cells" ); +if (clock_nb <0 ) { +dev_err (dev,"failed to get clock phandle(%d)\n" , clock_nb); +return clock_nb; + } + + ret =clk_get_by_index (dev,0 , &glue->clocks); +if (ret) { +dev_err (dev,"failed to get clock 0\n" ); +clk_free (&glue->clocks); + } + + reset_nb =ofnode_count_phandle_with_args (dev_ofnode (dev),"resets" , +"#reset-cells" ); +if (reset_nb <0 ) { +dev_err (dev,"failed to get reset phandle(%d)\n" , clock_nb); +return reset_nb; + } + + ret =reset_get_by_index (dev,0 , &glue->resets); +if (ret) { +dev_err (dev,"failed to get reset 0\n" ); +reset_free (&glue->resets); + } ret =generic_phy_get_by_name (dev,"usb" , &glue->phy);if (ret) {
@@ -499,8 +525,6 @@ static const struct sunxi_musb_config sun4i_a10_cfg = {static const struct sunxi_musb_config sun8i_h3_cfg = { .config = &musb_config_h3, - .rst_bit =23 , - .clkgate_bit =23 , };static const struct udevice_id sunxi_musb_ids[] = {
Signature · 1 line
2.17.1
RFC 33/35 phy: sun4i-usb: Use CLK and RESET support
In reply to Jagan TekiNow clock and reset drivers are available for respective SoC's so use clk and reset ops on phy driver.
--- drivers/phy/allwinner/phy-sun4i-usb.c | 63 ++++++++++++++++++--------- 1 file changed, 42 insertions(+), 21 deletions(-)
drivers/phy/allwinner/phy-sun4i-usb.c +42 -21
@@ -11,10 +11,12 @@*/ #include <common.h> +#include <clk.h> #include <dm.h> #include <dm/device.h> #include <generic-phy.h> #include <phy-sun4i-usb.h> +#include <reset.h> #include <asm/gpio.h> #include <asm/io.h> #include <asm/arch/clock.h>
@@ -88,38 +90,26 @@ struct sun4i_usb_phy_info {const char *gpio_vbus;const char *gpio_vbus_det;const char *gpio_id_det; -int rst_mask; } phy_info[] = { { .gpio_vbus = CONFIG_USB0_VBUS_PIN, .gpio_vbus_det = CONFIG_USB0_VBUS_DET, .gpio_id_det = CONFIG_USB0_ID_DET, - .rst_mask = (CCM_USB_CTRL_PHY0_RST | CCM_USB_CTRL_PHY0_CLK), }, { .gpio_vbus = CONFIG_USB1_VBUS_PIN, .gpio_vbus_det = NULL, .gpio_id_det = NULL, - .rst_mask = (CCM_USB_CTRL_PHY1_RST | CCM_USB_CTRL_PHY1_CLK), }, { .gpio_vbus = CONFIG_USB2_VBUS_PIN, .gpio_vbus_det = NULL, .gpio_id_det = NULL, -#ifdef CONFIG_MACH_SUN8I_A83T - .rst_mask = (CCM_USB_CTRL_HSIC_RST | CCM_USB_CTRL_HSIC_CLK | - CCM_USB_CTRL_12M_CLK), -#else - .rst_mask = (CCM_USB_CTRL_PHY2_RST | CCM_USB_CTRL_PHY2_CLK), -#endif }, { .gpio_vbus = CONFIG_USB3_VBUS_PIN, .gpio_vbus_det = NULL, .gpio_id_det = NULL, -#ifdef CONFIG_MACH_SUNXI_H3_H5 - .rst_mask = (CCM_USB_CTRL_PHY3_RST | CCM_USB_CTRL_PHY3_CLK), -#endif }, };
@@ -129,13 +119,13 @@ struct sun4i_usb_phy_plat {int gpio_vbus;int gpio_vbus_det;int gpio_id_det; -int rst_mask; +struct clk clocks; +struct reset_ctl resets;int id; };struct sun4i_usb_phy_data {void __iomem *base; -struct sunxi_ccm_reg *ccm;const struct sun4i_usb_phy_cfg *cfg;struct sun4i_usb_phy_plat *usb_phy; };
@@ -269,8 +259,19 @@ static int sun4i_usb_phy_init(struct phy *phy)struct sun4i_usb_phy_data *data =dev_get_priv (phy->dev);struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id];u32 val; +int ret; -setbits_le32 (&data->ccm->usb_clk_cfg, usb_phy->rst_mask); + ret =clk_enable (&usb_phy->clocks); +if (ret) { +dev_err (dev,"failed to enable usb_%ldphy clock\n" , phy->id); +return ret; + } + + ret =reset_deassert (&usb_phy->resets); +if (ret) { +dev_err (dev,"failed to deassert usb_%ldreset reset\n" , phy->id); +return ret; + }if (data->cfg->type == sun8i_a83t_phy) {if (phy->id ==0 ) {
@@ -311,6 +312,7 @@ static int sun4i_usb_phy_exit(struct phy *phy) {struct sun4i_usb_phy_data *data =dev_get_priv (phy->dev);struct sun4i_usb_phy_plat *usb_phy = &data->usb_phy[phy->id]; +int ret;if (phy->id ==0 ) {if (data->cfg->type == sun8i_a83t_phy) {
@@ -323,7 +325,17 @@ static int sun4i_usb_phy_exit(struct phy *phy)sun4i_usb_phy_passby (phy, false); -clrbits_le32 (&data->ccm->usb_clk_cfg, usb_phy->rst_mask); + ret =clk_disable (&usb_phy->clocks); +if (ret) { +dev_err (dev,"failed to disable usb_%ldphy clock\n" , phy->id); +return ret; + } + + ret =reset_assert (&usb_phy->resets); +if (ret) { +dev_err (dev,"failed to assert usb_%ldreset reset\n" , phy->id); +return ret; + }return 0 ; }
@@ -410,10 +422,6 @@ static int sun4i_usb_phy_probe(struct udevice *dev)if (IS_ERR (data->base))return PTR_ERR (data->base); - data->ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE ; -if (IS_ERR (data->ccm)) -return PTR_ERR (data->ccm); - data->usb_phy = plat;for (i =0 ; i < data->cfg->num_phys; i++) {struct sun4i_usb_phy_plat *phy = &plat[i];
@@ -451,6 +459,20 @@ static int sun4i_usb_phy_probe(struct udevice *dev)sunxi_gpio_set_pull (phy->gpio_id_det,SUNXI_GPIO_PULL_UP ); } +snprintf (name,sizeof (name),"usb%d_phy" , i); + ret =clk_get_by_name (dev, name, &phy->clocks); +if (ret) { +dev_err (dev,"failed to get usb%d_phy clock phandle\n" , i); +return ret; + } + +snprintf (name,sizeof (name),"usb%d_reset" , i); + ret =reset_get_by_name (dev, name, &phy->resets); +if (ret) { +dev_err (dev,"failed to get usb%d_reset reset phandle\n" , i); +return ret; + } +if (i || data->cfg->phy0_dual_route) {snprintf (name,sizeof (name),"pmu%d" , i); phy->pmu = (void __iomem *)devfdt_get_addr_name (dev, name);
@@ -459,7 +481,6 @@ static int sun4i_usb_phy_probe(struct udevice *dev) } phy->id = i; - phy->rst_mask = info->rst_mask; };debug ("Allwinner Sun4I USB PHY driver loaded\n" );
Signature · 1 line
2.17.1
RFC 34/35 sunxi: usb: Switch to Generic host controllers
In reply to Jagan TekiOnce of key blocker for using USB Generic host controller drivers in Allwinner are CLK and RESET drivers, now these available for USB usage. So switch to use EHCI and OHCI Generic controllers.
Enabling USB is wisely a board choise, so Enable USB_OHCI_HCD where it already have USB_EHCI_HCD
--- configs/A10-OLinuXino-Lime_defconfig | 1 + configs/A10s-OLinuXino-M_defconfig | 1 + configs/A13-OLinuXinoM_defconfig | 1 + configs/A13-OLinuXino_defconfig | 1 + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 1 + configs/A20-OLinuXino-Lime2_defconfig | 1 + configs/A20-OLinuXino-Lime_defconfig | 1 + configs/A20-Olimex-SOM204-EVB_defconfig | 2 ++ configs/Auxtek-T003_defconfig | 1 + configs/Auxtek-T004_defconfig | 1 + configs/Bananapi_defconfig | 1 + configs/Bananapi_m2m_defconfig | 1 + configs/Bananapro_defconfig | 1 + configs/CHIP_defconfig | 1 + configs/CHIP_pro_defconfig | 1 + configs/CSQ_CS908_defconfig | 1 + configs/Colombus_defconfig | 1 + configs/Cubieboard2_defconfig | 1 + configs/Cubieboard_defconfig | 1 + configs/Cubietruck_plus_defconfig | 1 + configs/Hummingbird_A31_defconfig | 1 + configs/Itead_Ibox_A20_defconfig | 1 + configs/Linksprite_pcDuino3_Nano_defconfig | 1 + configs/Linksprite_pcDuino3_defconfig | 1 + configs/Linksprite_pcDuino_defconfig | 1 + configs/MK808C_defconfig | 1 + configs/Marsboard_A10_defconfig | 1 + configs/Mele_A1000G_quad_defconfig | 1 + configs/Mele_A1000_defconfig | 1 + configs/Mele_I7_defconfig | 1 + configs/Mele_M3_defconfig | 1 + configs/Mele_M5_defconfig | 1 + configs/Mele_M9_defconfig | 1 + configs/Mini-X_defconfig | 1 + configs/Orangepi_defconfig | 1 + configs/Orangepi_mini_defconfig | 1 + configs/Sinlinx_SinA31s_defconfig | 1 + configs/Sinlinx_SinA33_defconfig | 1 + configs/Sinovoip_BPI_M2_Plus_defconfig | 1 + configs/Sinovoip_BPI_M2_defconfig | 1 + configs/Sinovoip_BPI_M3_defconfig | 1 + configs/Wexler_TAB7200_defconfig | 1 + configs/Wobo_i5_defconfig | 1 + configs/a64-olinuxino_defconfig | 1 + configs/ba10_tv_box_defconfig | 1 + configs/bananapi_m1_plus_defconfig | 1 + configs/bananapi_m64_defconfig | 1 + configs/ga10h_v1_1_defconfig | 1 + configs/h8_homlet_v2_defconfig | 1 + configs/i12-tvbox_defconfig | 1 + configs/icnova-a20-swac_defconfig | 1 + configs/inet1_defconfig | 1 + configs/inet_q972_defconfig | 1 + configs/jesurun_q5_defconfig | 1 + configs/libretech_all_h3_cc_h2_plus_defconfig | 1 + configs/libretech_all_h3_cc_h3_defconfig | 1 + configs/libretech_all_h3_cc_h5_defconfig | 1 + configs/mixtile_loftq_defconfig | 1 + configs/mk802_a10s_defconfig | 1 + configs/mk802_defconfig | 1 + configs/mk802ii_defconfig | 1 + configs/nanopi_a64_defconfig | 1 + configs/nanopi_m1_defconfig | 1 + configs/nanopi_m1_plus_defconfig | 1 + configs/nanopi_neo2_defconfig | 1 + configs/nanopi_neo_air_defconfig | 1 + configs/nanopi_neo_defconfig | 1 + configs/nanopi_neo_plus2_defconfig | 1 + configs/orangepi_2_defconfig | 1 + configs/orangepi_lite_defconfig | 1 + configs/orangepi_one_defconfig | 1 + configs/orangepi_pc2_defconfig | 1 + configs/orangepi_pc_defconfig | 1 + configs/orangepi_pc_plus_defconfig | 1 + configs/orangepi_plus2e_defconfig | 1 + configs/orangepi_plus_defconfig | 1 + configs/orangepi_prime_defconfig | 1 + configs/orangepi_r1_defconfig | 1 + configs/orangepi_win_defconfig | 1 + configs/orangepi_zero_defconfig | 1 + configs/orangepi_zero_plus2_defconfig | 1 + configs/orangepi_zero_plus_defconfig | 1 + configs/parrot_r16_defconfig | 1 + configs/pine64_plus_defconfig | 1 + configs/r7-tv-dongle_defconfig | 1 + configs/sopine_baseboard_defconfig | 1 + configs/sun8i_a23_evb_defconfig | 1 + configs/sunxi_Gemei_G9_defconfig | 1 + configs/tbs_a711_defconfig | 1 + drivers/usb/host/Kconfig | 2 ++ include/configs/sun4i.h | 4 ---- include/configs/sun50i.h | 5 ----- include/configs/sun5i.h | 4 ---- include/configs/sun6i.h | 4 ---- include/configs/sun7i.h | 4 ---- include/configs/sun8i.h | 4 ---- include/configs/sunxi-common.h | 1 - 97 files changed, 92 insertions(+), 26 deletions(-)
configs/A10-OLinuXino-Lime_defconfig +1 -0
@@ -20,5 +20,6 @@ CONFIG_SUN4I_EMAC=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A10s-OLinuXino-M_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_SPL_I2C_SUPPORT=y CONFIG_SUN4I_EMAC=y CONFIG_AXP152_POWER=y CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A13-OLinuXinoM_defconfig +1 -0
@@ -18,5 +18,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino-micro" # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUNXI_NO_PMIC=y CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A13-OLinuXino_defconfig +1 -0
@@ -25,6 +25,7 @@ CONFIG_DFU_RAM=y CONFIG_FASTBOOT_CMD_OEM_FORMAT=y CONFIG_AXP_ALDO3_VOLT=3300 CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A20-OLinuXino-Lime2-eMMC_defconfig +1 -0
@@ -28,6 +28,7 @@ CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_FASTBOOT_FLASH_MMC_DEV=1
configs/A20-OLinuXino-Lime2_defconfig +1 -0
@@ -26,6 +26,7 @@ CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A20-OLinuXino-Lime_defconfig +1 -0
@@ -19,5 +19,6 @@ CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/A20-Olimex-SOM204-EVB_defconfig +2 -0
@@ -1,4 +1,5 @@ CONFIG_ARM=y +CONFIG_USB_OHCI_HCD=y CONFIG_ARCH_SUNXI=y CONFIG_SPL=y CONFIG_MACH_SUN7I=y
@@ -27,6 +28,7 @@ CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO3_VOLT=2800 CONFIG_AXP_ALDO4_VOLT=2800 CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Auxtek-T003_defconfig +1 -0
@@ -14,5 +14,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP152_POWER=y CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Auxtek-T004_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP152_POWER=y CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Bananapi_defconfig +1 -0
@@ -19,5 +19,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Bananapi_m2m_defconfig +1 -0
@@ -14,6 +14,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-bananapi-m2m" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_PARTITION_UUIDS is not set CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_USB_FUNCTION_MASS_STORAGE=y
configs/Bananapro_defconfig +1 -0
@@ -22,5 +22,6 @@ CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO4_VOLT=2500 CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/CHIP_defconfig +1 -0
@@ -16,6 +16,7 @@ CONFIG_DFU_RAM=y CONFIG_AXP_ALDO3_VOLT=3300 CONFIG_AXP_ALDO4_VOLT=3300 CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/CHIP_pro_defconfig +1 -0
@@ -20,6 +20,7 @@ CONFIG_SYS_NAND_OOBSIZE=0x100 CONFIG_AXP_ALDO3_VOLT=3300 CONFIG_AXP_ALDO4_VOLT=3300 CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/CSQ_CS908_defconfig +1 -0
@@ -14,6 +14,7 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO1_VOLT=3300 CONFIG_AXP_DLDO1_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Colombus_defconfig +1 -0
@@ -24,5 +24,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO1_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubieboard2_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_SCSI_AHCI=y CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubieboard_defconfig +1 -0
@@ -15,5 +15,6 @@ CONFIG_SPL_I2C_SUPPORT=y CONFIG_SCSI_AHCI=y CONFIG_SUN4I_EMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Cubietruck_plus_defconfig +1 -0
@@ -22,6 +22,7 @@ CONFIG_CONSOLE_MUX=y CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_DLDO4_VOLT=3300 CONFIG_AXP_FLDO1_VOLT=1200 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Hummingbird_A31_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO1_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Itead_Ibox_A20_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_SCSI_AHCI=y CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Linksprite_pcDuino3_Nano_defconfig +1 -0
@@ -19,5 +19,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Linksprite_pcDuino3_defconfig +1 -0
@@ -18,5 +18,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y CONFIG_DM_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Linksprite_pcDuino_defconfig +1 -0
@@ -11,5 +11,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN4I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/MK808C_defconfig +1 -0
@@ -9,5 +9,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Marsboard_A10_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_SCSI_AHCI=y CONFIG_SUN4I_EMAC=y CONFIG_SUNXI_NO_PMIC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_A1000G_quad_defconfig +1 -0
@@ -17,6 +17,7 @@ CONFIG_AXP_DCDC1_VOLT=3300 CONFIG_AXP_ALDO1_VOLT=3300 CONFIG_AXP_DLDO1_VOLT=3300 CONFIG_AXP_DLDO4_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_A1000_defconfig +1 -0
@@ -15,5 +15,6 @@ CONFIG_SPL_I2C_SUPPORT=y CONFIG_SCSI_AHCI=y CONFIG_SUN4I_EMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_I7_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_AXP_DCDC1_VOLT=3300 CONFIG_AXP_ALDO1_VOLT=3300 CONFIG_AXP_DLDO1_VOLT=3300 CONFIG_AXP_DLDO4_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_M3_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_M5_defconfig +1 -0
@@ -17,5 +17,6 @@ CONFIG_SCSI_AHCI=y CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mele_M9_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_AXP_DCDC1_VOLT=3300 CONFIG_AXP_ALDO1_VOLT=3300 CONFIG_AXP_DLDO1_VOLT=3300 CONFIG_AXP_DLDO4_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Mini-X_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Orangepi_defconfig +1 -0
@@ -21,5 +21,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Orangepi_mini_defconfig +1 -0
@@ -24,5 +24,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinlinx_SinA31s_defconfig +1 -0
@@ -17,5 +17,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-sina31s" CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y CONFIG_AXP_DLDO1_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinlinx_SinA33_defconfig +1 -0
@@ -20,6 +20,7 @@ CONFIG_CMD_DFU=y # CONFIG_SPL_PARTITION_UUIDS is not set CONFIG_DFU_RAM=y CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_FASTBOOT_FLASH_MMC_DEV=1
configs/Sinovoip_BPI_M2_Plus_defconfig +1 -0
@@ -13,6 +13,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-bananapi-m2-plus" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinovoip_BPI_M2_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO1_VOLT=3300 CONFIG_AXP_ALDO2_VOLT=1800 CONFIG_AXP_DLDO1_VOLT=3000 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Sinovoip_BPI_M3_defconfig +1 -0
@@ -23,6 +23,7 @@ CONFIG_CONSOLE_MUX=y CONFIG_AXP_DCDC5_VOLT=1200 CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_SW_ON=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Wexler_TAB7200_defconfig +1 -0
@@ -17,6 +17,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/Wobo_i5_defconfig +1 -0
@@ -14,5 +14,6 @@ CONFIG_SPL_I2C_SUPPORT=y CONFIG_AXP_ALDO3_VOLT=3300 CONFIG_AXP_ALDO4_VOLT=3300 CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/a64-olinuxino_defconfig +1 -0
@@ -10,5 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-olinuxino" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/ba10_tv_box_defconfig +1 -0
@@ -14,6 +14,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN4I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/bananapi_m1_plus_defconfig +1 -0
@@ -19,4 +19,5 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_SCSI=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y
configs/bananapi_m64_defconfig +1 -0
@@ -11,6 +11,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-bananapi-m64" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/ga10h_v1_1_defconfig +1 -0
@@ -22,6 +22,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-a33-ga10h-v1.1" # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP_DLDO1_VOLT=3300 CONFIG_CONS_INDEX=5 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/h8_homlet_v2_defconfig +1 -0
@@ -15,6 +15,7 @@ CONFIG_CONSOLE_MUX=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP_DLDO4_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/i12-tvbox_defconfig +1 -0
@@ -13,5 +13,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/icnova-a20-swac_defconfig +1 -0
@@ -20,5 +20,6 @@ CONFIG_CMD_UNZIP=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_ETH_DESIGNWARE=y CONFIG_SUN7I_GMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet1_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/inet_q972_defconfig +1 -0
@@ -19,6 +19,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31s-inet-q972" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP_DLDO1_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/jesurun_q5_defconfig +1 -0
@@ -13,6 +13,7 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN4I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_HOST=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/libretech_all_h3_cc_h2_plus_defconfig +1 -0
@@ -11,5 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-libretech-all-h3-cc" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/libretech_all_h3_cc_h3_defconfig +1 -0
@@ -11,5 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-libretech-all-h3-cc" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/libretech_all_h3_cc_h5_defconfig +1 -0
@@ -11,5 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-libretech-all-h3-cc" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mixtile_loftq_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_RGMII=y CONFIG_SUN7I_GMAC=y CONFIG_AXP_ALDO1_VOLT=3300 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mk802_a10s_defconfig +1 -0
@@ -13,5 +13,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP152_POWER=y CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mk802_defconfig +1 -0
@@ -9,5 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mk802" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUNXI_NO_PMIC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/mk802ii_defconfig +1 -0
@@ -8,5 +8,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_a64_defconfig +1 -0
@@ -9,5 +9,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-nanopi-a64" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_m1_defconfig +1 -0
@@ -10,5 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-m1" # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_m1_plus_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-nanopi-m1-plus" # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo2_defconfig +1 -0
@@ -10,5 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-neo2" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo_air_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_CONSOLE_MUX=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo_defconfig +1 -0
@@ -13,5 +13,6 @@ CONFIG_CONSOLE_MUX=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/nanopi_neo_plus2_defconfig +1 -0
@@ -12,4 +12,5 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-nanopi-neo-plus2" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y
configs/orangepi_2_defconfig +1 -0
@@ -15,5 +15,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y CONFIG_SY8106A_POWER=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_lite_defconfig +1 -0
@@ -10,5 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-lite" # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_one_defconfig +1 -0
@@ -11,5 +11,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h3-orangepi-one" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_pc2_defconfig +1 -0
@@ -12,6 +12,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-pc2" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_pc_defconfig +1 -0
@@ -13,5 +13,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y CONFIG_SY8106A_POWER=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_pc_plus_defconfig +1 -0
@@ -14,5 +14,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y CONFIG_SY8106A_POWER=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_plus2e_defconfig +1 -0
@@ -15,5 +15,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y CONFIG_SY8106A_POWER=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_plus_defconfig +1 -0
@@ -17,5 +17,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y CONFIG_SY8106A_POWER=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_prime_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-prime" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_r1_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" CONFIG_CONSOLE_MUX=y # CONFIG_CMD_FLASH is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_win_defconfig +1 -0
@@ -10,5 +10,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-orangepi-win" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_zero_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-zero" CONFIG_CONSOLE_MUX=y # CONFIG_CMD_FLASH is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_zero_plus2_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus2" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/orangepi_zero_plus_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-h5-orangepi-zero-plus" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/parrot_r16_defconfig +1 -0
@@ -17,6 +17,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-r16-parrot" # CONFIG_SPL_PARTITION_UUIDS is not set CONFIG_FASTBOOT_CMD_OEM_FORMAT=y CONFIG_CONS_INDEX=5 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/pine64_plus_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_OF_LIST="sun50i-a64-pine64 sun50i-a64-pine64-plus" CONFIG_PHY_REALTEK=y CONFIG_RTL8211E_PINE64_GIGABIT_FIX=y CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/r7-tv-dongle_defconfig +1 -0
@@ -12,5 +12,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_SPL_EFI_PARTITION is not set CONFIG_AXP152_POWER=y CONFIG_CONS_INDEX=2 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/sopine_baseboard_defconfig +1 -0
@@ -16,5 +16,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun50i-a64-sopine-baseboard" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_SUN8I_EMAC=y +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/sun8i_a23_evb_defconfig +1 -0
@@ -13,5 +13,6 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-evb" # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_CONS_INDEX=5 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/sunxi_Gemei_G9_defconfig +1 -0
@@ -15,5 +15,6 @@ CONFIG_SPL_I2C_SUPPORT=y # CONFIG_CMD_FLASH is not set # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y
configs/tbs_a711_defconfig +1 -0
@@ -18,6 +18,7 @@ CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-tbs-a711" # CONFIG_SPL_EFI_PARTITION is not set CONFIG_FASTBOOT_CMD_OEM_FORMAT=y CONFIG_AXP_DCDC5_VOLT=1200 +CONFIG_USB_OHCI_HCD=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_MUSB_GADGET=y CONFIG_USB_FUNCTION_MASS_STORAGE=y
drivers/usb/host/Kconfig +2 -0
@@ -191,6 +191,7 @@ config USB_EHCI_GENERIC bool "Support for generic EHCI USB controller" depends on OF_CONTROL depends on DM_USB + default ARCH_SUNXI default n ---help--- Enables support for generic EHCI controller.
@@ -221,6 +222,7 @@ config USB_OHCI_GENERIC bool "Support for generic OHCI USB controller" depends on OF_CONTROL depends on DM_USB + default ARCH_SUNXI select USB_HOST ---help--- Enables support for generic OHCI controller.
include/configs/sun4i.h +0 -4
@@ -11,10 +11,6 @@* A10 specific configuration */ -#ifdef CONFIG_USB_EHCI_HCD -#define CONFIG_USB_EHCI_SUNXI -#endif -/* * Include common sunxi configuration where most the settings are */
include/configs/sun50i.h +0 -5
@@ -10,11 +10,6 @@* A64 specific configuration */ -#ifdef CONFIG_USB_EHCI_HCD -#define CONFIG_USB_EHCI_SUNXI -#define CONFIG_USB_MAX_CONTROLLER_COUNT 1 -#endif -#define GICD_BASE 0x1c81000#define GICC_BASE 0x1c82000
include/configs/sun5i.h +0 -4
@@ -11,10 +11,6 @@* High Level Configuration Options */ -#ifdef CONFIG_USB_EHCI_HCD -#define CONFIG_USB_EHCI_SUNXI -#endif -/* * Include common sunxi configuration where most the settings are */
include/configs/sun6i.h +0 -4
@@ -14,10 +14,6 @@* A31 specific configuration */ -#ifdef CONFIG_USB_EHCI_HCD -#define CONFIG_USB_EHCI_SUNXI -#endif -#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE#define CONFIG_ARMV7_SECURE_MAX_SIZE (64 * 1024)/* 64 KB */
include/configs/sun7i.h +0 -4
@@ -12,10 +12,6 @@* A20 specific configuration */ -#ifdef CONFIG_USB_EHCI_HCD -#define CONFIG_USB_EHCI_SUNXI -#endif -#define CONFIG_ARMV7_SECURE_BASE SUNXI_SRAM_B_BASE#define CONFIG_ARMV7_SECURE_MAX_SIZE (64 * 1024)/* 64 KB */
include/configs/sun8i.h +0 -4
@@ -12,10 +12,6 @@* A23 specific configuration */ -#ifdef CONFIG_USB_EHCI_HCD -#define CONFIG_USB_EHCI_SUNXI -#endif -/* * Include common sunxi configuration where most the settings are */
include/configs/sunxi-common.h +0 -1
@@ -297,7 +297,6 @@ extern int soft_i2c_gpio_scl;#ifdef CONFIG_USB_EHCI_HCD #define CONFIG_USB_OHCI_NEW -#define CONFIG_USB_OHCI_SUNXI #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 1#endif
Signature · 1 line
2.17.1
RFC 35/35 usb: host: Drop [e-o]hci-sunxi drivers
In reply to Jagan TekiNow Allwinner platform is all set to use Generic USB controller drivers, so remove the legacy sunxi drivers.
--- drivers/usb/host/Makefile | 2 - drivers/usb/host/ehci-sunxi.c | 204 ----------------------------- drivers/usb/host/ohci-sunxi.c | 233 ---------------------------------- scripts/config_whitelist.txt | 2 - 4 files changed, 441 deletions(-) delete mode 100644 drivers/usb/host/ehci-sunxi.c delete mode 100644 drivers/usb/host/ohci-sunxi.c
drivers/usb/host/Makefile +0 -2
@@ -15,7 +15,6 @@ obj-$(CONFIG_USB_OHCI_DA8XX) += ohci-da8xx.o obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o obj-$(CONFIG_USB_SL811HS) += sl811-hcd.o obj-$(CONFIG_USB_OHCI_EP93XX) += ohci-ep93xx.o -obj-$(CONFIG_USB_OHCI_SUNXI) += ohci-sunxi.o obj-$(CONFIG_USB_OHCI_LPC32XX) += ohci-lpc32xx.o obj-$(CONFIG_USB_OHCI_GENERIC) += ohci-generic.o
@@ -37,7 +36,6 @@ obj-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o obj-$(CONFIG_USB_EHCI_MSM) += ehci-msm.o obj-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o obj-$(CONFIG_USB_EHCI_SPEAR) += ehci-spear.o -obj-$(CONFIG_USB_EHCI_SUNXI) += ehci-sunxi.o obj-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o obj-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o obj-$(CONFIG_USB_EHCI_VF) += ehci-vf.o
drivers/usb/host/ehci-sunxi.c deleted +0 -204
204 lines not on this page · raw message
drivers/usb/host/ohci-sunxi.c deleted +0 -233
233 lines not on this page · raw message
scripts/config_whitelist.txt +0 -2
@@ -4622,7 +4622,6 @@ CONFIG_USB_EHCI_MX5 CONFIG_USB_EHCI_MXC CONFIG_USB_EHCI_MXS CONFIG_USB_EHCI_SPEAR -CONFIG_USB_EHCI_SUNXI CONFIG_USB_EHCI_TEGRA CONFIG_USB_EHCI_TXFIFO_THRESH CONFIG_USB_EHCI_VCT
@@ -4664,7 +4663,6 @@ CONFIG_USB_OHCI CONFIG_USB_OHCI_EP93XX CONFIG_USB_OHCI_LPC32XX CONFIG_USB_OHCI_NEW -CONFIG_USB_OHCI_SUNXI CONFIG_USB_OTG CONFIG_USB_OTG_BLACKLIST_HUB CONFIG_USB_PHY_CFG_BASE
Signature · 1 line
2.17.1
cover sunxi: Add initial CLK, RESET support
In reply to Jagan TekiQuoted 27 lines · Jagan Teki
This is series is trying to add initial support for CLK and RESET drivers for Allwinner SoC's with USB as a starting IP.
Linux handle both clock and reset as ccu with common DT bindings, but besides that U-Boot handle them separately with individual generic uclass functions. So we need have a separate drivers for CLK and RESET with common DT binding.
This series is trying to resolve this by binding the reset driver from CLK driver .bind call. First of all the CLK driver will probe based on DT compatible and the .bind call of CLK driver will bind the respective reset driver based on uclass driver name.
I would prefer USB can be initial IP to go, since it doesn't rely on dm pinctrl or any other dm stuff require.
Tested this on A64, H5, H3 but I still need to have closer look on other SoCs.
All these changes available at u-boot-sunxi/clk
Suggestions,
Jagan.Andre Przywara (1):
sunxi: clk: add DM clock driver template for the A64 SoC
Quoted 9 lines
Jagan Teki (34):
clk:Kconfig: Ascending order to sub directiory kconfigs
net:sun8i_emac: Make proper order for include files
mtd:sunxi_nand_spl: Make proper order for include files
dt-bindings: reset: Syncsun4i-a10-ccu.hfrom Linux
dt-bindings: clock: Syncsun5i-ccu.hfrom Linux
dt-bindings: reset: Syncsun5i-ccu.hfrom Linux
dt-bindings: clock: Syncsun6i-a31-ccu.hfrom Linux
dt-bindings: reset: Syncsun6i-a31-ccu.hfrom Linux
This is a preference of mine: Could you sync them all in one go to a recent release or -rc? And also mention the version in the commit subject? It would be much easier to maintain if people didn't have to go dig through the Linux repository looking for a specific git commit. Instead they could just look at the subject and judge whether it's recent or not.
Quoted 3 lines
clk: sunxi: Add
Kconfigentry
clk: sunxi: a64: Add disable function
clk: sunxi: a64: Implement USB clocks
These 3, plus Andre's patch, can be squashed into one. At this point you actually have a driver that can do something, which is what we're interested in, not the details of how you manage your development cycle.
Quoted 4 lines
reset: sunxi: Add DM reset driver template for the A64 SoC
reset: sunxi: a64: Bind reset from clock driver
reset: Add default request ops
reset: sunxi: a64: Implement USB resets
Same here. The commits should be one adding a default request ops, then another adding a _useful_ reset driver, complete with binding the driver to use it.
BTW, would it make sense, or would it be possible, to have both the clock and reset drivers in the same file? It may be possible to share some code, such as access helpers, this way. Also, building one but not the other doesn't make sense. At the very least, have them share a Kconfig symbol, or make one selected by the other and invisible to the user.
Thanks
ChenYu
Quoted 19 lines
clk: sunxi: Add initial CLK driver for
H3_H5
reset: sunxi: Add initial RESET driver forH3_H5
clk: sunxi: Add initial CLK driver for A10/A20
reset: sunxi: Add initial RESET driver for A10/A20
clk: sunxi: Add initial CLK driver for A10s/A13
reset: sunxi: Add initial RESET driver for A10s/A13
clk: sunxi: Add initial CLK driver for A31/A31s
reset: sunxi: Add initial RESET driver for A31/A31s
clk: sunxi: Add initial CLK driver for A23
reset: sunxi: Add initial RESET driver for A23
clk: sunxi: a23: Add CLK support for A33
reset: sunxi: a23: Add RESET support A33
clk: sunxi: Add initial CLK driver for A83T
reset: sunxi: Add initial RESET driver for A83T
sunxi: Enable CLK and RESET
musb-new: sunxi: Use CLK and RESET support
phy: sun4i-usb: Use CLK and RESET support
sunxi: usb: Switch to Generic host controllers
usb: host: Drop [e-o]hci-sunxi drivers