Skip to contentSkip to conversation

Add DM support for omap PWM backlight

PATCH Superseded Dario Binacchi 4 participants 25 messages Nov 22, 2020 – Dec 23, 2020

Subsystems (7)

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v6 cover Add DM support for omap PWM backlight

The series was born from the need to manage the PWM backlight of the display connected to my beaglebone board. To hit the target, I had to develop drivers for PWM management which in turn relied on drivers for managing timers and clocks, all developed according to the driver model. My intention was to use the SoC-specific API only at strictly necessary points in the code. My previous patches for migrating the AM335x display driver to the driver model had required the implementation of additional functions outside the concerns of the driver, (settings for dividing the pixel clock rate, configuring the display DPLL rate, ....) not being able to use the API of the related clock drivers. This series shouldn't have repeated the same kind of mistake. Furthermore, I also wanted to fix that kind of forced choice. Almost everything should have been accessible via the driver model API. In the series there are also some patches that could be submitted separately, but which I have however inserted to avoid applying future patches to incorporate them.
With this last consideration, I hope I have convincingly justified the large number of patches in the series.

The patch enabling address translation into a CPU physical address from device-tree even in case of crossing levels with #size-cells = <0>, is crucial for the series. The previous implementation was unable to perform the address translation required by the am33xx device tree. I tried to apply in a conservative way as few changes as possible and to verify the execution of all the tests already developed, as well as the new ones I added for the new feature.

The patch series can be cleanly applied to the HEAD of the master which at the time of release points to 12e396303c commit.

Changes in v6:
- Remove the 'am3-prcm' driver.
- Add the 'simple-bus' compatible string to the prcm_clocks node.
- Remove the 'am3-scm' driver.
- Add the 'simple-bus' compatible string to the scm_clocks node.

Changes in v5:
- Create drivers/clk/ti directory.
- Move the clk-ti-mux.c file to drivers/clk/ti and rename it clk-mux.c
- Move the clk-ti-am3-dpll.c file to drivers/clk/ti with the name clk-am3-dpll.c.
- Move the clk-ti-am3-dpll-x2.c file to drivers/clk/ti with the name clk-am3-dpll-x2.c.
- Move the clk-ti.c file to drivers/clk/ti with the name clk.c.
- Move the clk-ti.h file to drivers/clk/ti with the name clk.h.
- Move the clk-ti-divider.c file to drivers/clk/ti with the name clk-divider.c.
- Move the clk-ti-gate.c file to drivers/clk/ti with the name clk-gate.c.
- Move the clk-ti-ctrl.c file to drivers/clk/ti with the name clk-ctrl.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Remove a blank line at end of file arch/arm/dts/am33xx-l4.dtsi.
- Update clk_round_rate description.
- Add Sean Anderson review.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Simon Glass review.
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/clock-bindings.txt.
- Remove doc/device-tree-bindings/clock/ti,mux.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,dpll.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,autoidle.txt.
- Remove doc/device-tree-bindings/clock/ti,divider.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/gpio-gate-clock.txt.
- Remove doc/device-tree-bindings/clock/ti,clockdomain.txt.
- Remove doc/device-tree-bindings/clock/ti,gate.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Fix access to registers listed by device tree following resync of am33xx-clock.dtsi with Linux 5.9-rc7.
- Remove doc/device-tree-bindings/clock/ti,clkctrl.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- doc/device-tree-bindings/arm/omap,prcm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Add to commit message the references to linux kernel dt binding documentation.
- Comment dm_flags field in the global_data structure.
- Remove doc/device-tree-bindings/arm/omap,ctrl.txt.
- Remove doc/device-tree-bindings/pinctrl/pinctrl-single.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Adds PWM_TI_EHRPWM dependency on ARCH_OMAP2PLUS in Kconfig.
- Add error message in case of invalid address.
- Remove doc/device-tree-bindings/pwm/ti,ehrpwm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Move Kconfig symbol from drivers/pwm to drivers/bus.
- Remove the domain clock reference from the pwmss nodes of the device tree in am33xx.dtsi. The resync of am33xx.dtsi with Linux 5.9-rc7 already contains such references.
- Remove domain clock enabling/disabling. Enabling the domain clock is performed by the sysc interconnect target module driver during the pwm device probing.
- Remove doc/device-tree-bindings/pwm/ti,pwmss.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Update the DTS lcdc node of the am335x boards because of the am33xx.dtsi resynced with Linux 5.9-rc7.
- Remove clock domain enabling/disabling.
- Update the commit message.
- Add clk.h header.
- Fix an error code returned by the probe function.

Changes in v2:
- Add the clk_ prefix to the divider functions.
- Add kernel-doc comments to the exported functions.
- Merged to patch [09/31] clk: ti: refactor mux and divider clock drivers.
- Remove the 'ti_am3_prcm_clocks' driver. Handle 'prcm_clocks' node in the 'ti_am3_prcm' driver.
- Update the commit message.
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.
- Remove the 'ti_am3_scm_clocks' driver. Handle 'scm_clocks' node in the 'ti_am3_scm' driver.
- Update the commit message.

Dario Binacchi (28):
clk: export generic routines
dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7
bus: ti: add minimal sysc interconnect target driver
arm: dts: sync am33xx with Linux 5.9-rc7
clk: add clk_round_rate()
clk: ti: add mux clock driver
arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro
clk: ti: am33xx: add DPLL clock drivers
clk: ti: add divider clock driver
clk: ti: add gate clock driver
arm: dts: am335x: include am33xx-u-boot.dtsi
ti: am33xx: fix do_enable_clocks() to accept NULL parameters
clk: ti: add support for clkctrl clocks
clk: ti: omap4: add clock manager driver
arm: dts: am335x: enable prcm_clocks auto binding
clk: move clk-ti-sci driver to 'ti' directory
fdt: translate address if #size-cells = <0>
omap: timer: fix the rate setting
arm: dts: am335x: enable scm_clocks auto binding
pwm: ti: am33xx: add enhanced pwm driver
bus: ti: am33xx: add pwm subsystem driver
dm: core: add a function to decode display timings
video: omap: add panel driver
video: omap: drop domain clock enabling by SOC api
video: omap: set LCD clock rate through DM API
video: omap: split the legacy code from the DM code
video: omap: move drivers to 'ti' directory
board: ti: am335x-ice: get CDCE913 clock device

 arch/arm/Kconfig                           |    1 +
 arch/arm/dts/am335x-brppt1-mmc.dts         |   17 +-
 arch/arm/dts/am335x-brppt1-nand.dts        |   17 +-
 arch/arm/dts/am335x-brppt1-spi.dts         |   17 +-
 arch/arm/dts/am335x-brsmarc1.dts           |   20 +-
 arch/arm/dts/am335x-brxre1.dts             |   21 +-
 arch/arm/dts/am335x-chiliboard-u-boot.dtsi |    2 +
 arch/arm/dts/am335x-draco.dtsi             |   11 +-
 arch/arm/dts/am335x-evm-u-boot.dtsi        |   17 +-
 arch/arm/dts/am335x-evm.dts                |    2 +-
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-evmsk.dts              |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi   |   25 +-
 arch/arm/dts/am335x-icev2-u-boot.dtsi      |    3 +
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     |   20 +-
 arch/arm/dts/am335x-pxm2.dtsi              |    2 +-
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-regor-rdk-u-boot.dtsi  |    2 +
 arch/arm/dts/am335x-rut-u-boot.dtsi        |   16 +-
 arch/arm/dts/am335x-rut.dts                |    2 +-
 arch/arm/dts/am335x-shc-u-boot.dtsi        |    2 +
 arch/arm/dts/am335x-shc.dts                |    2 +-
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi   |    2 +
 arch/arm/dts/am33xx-clocks.dtsi            |  106 +-
 arch/arm/dts/am33xx-l4.dtsi                | 1962 ++++++++++++++++++++
 arch/arm/dts/am33xx-u-boot.dtsi            |    8 +
 arch/arm/dts/am33xx.dtsi                   |  721 +++----
 arch/arm/dts/da850-evm-u-boot.dtsi         |   18 +-
 arch/arm/include/asm/arch-am33xx/clock.h   |    1 +
 arch/arm/mach-omap2/am33xx/clock.c         |   10 +-
 arch/arm/mach-omap2/am33xx/clock_am33xx.c  |    2 +-
 arch/sandbox/dts/test.dts                  |   67 +
 arch/sandbox/include/asm/clk.h             |    9 +
 board/ti/am335x/board.c                    |    2 +-
 board/ti/am43xx/board.c                    |    2 +-
 common/fdt_support.c                       |    6 +-
 drivers/bus/Kconfig                        |   13 +
 drivers/bus/Makefile                       |    2 +
 drivers/bus/ti-pwmss.c                     |   21 +
 drivers/bus/ti-sysc.c                      |  166 ++
 drivers/clk/Kconfig                        |    9 +-
 drivers/clk/Makefile                       |    2 +-
 drivers/clk/clk-divider.c                  |   24 +-
 drivers/clk/clk-uclass.c                   |   15 +
 drivers/clk/clk_sandbox.c                  |   17 +
 drivers/clk/clk_sandbox_test.c             |   10 +
 drivers/clk/ti/Kconfig                     |   43 +
 drivers/clk/ti/Makefile                    |   13 +
 drivers/clk/ti/clk-am3-dpll-x2.c           |   79 +
 drivers/clk/ti/clk-am3-dpll.c              |  268 +++
 drivers/clk/ti/clk-ctrl.c                  |  154 ++
 drivers/clk/ti/clk-divider.c               |  381 ++++
 drivers/clk/ti/clk-gate.c                  |   93 +
 drivers/clk/ti/clk-mux.c                   |  253 +++
 drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} |    0
 drivers/clk/ti/clk.c                       |   34 +
 drivers/clk/ti/clk.h                       |   13 +
 drivers/clk/ti/omap4-cm.c                  |   22 +
 drivers/core/Kconfig                       |   12 +
 drivers/core/fdtaddr.c                     |    2 +-
 drivers/core/of_addr.c                     |   14 +-
 drivers/core/ofnode.c                      |    7 +-
 drivers/core/read.c                        |    6 +
 drivers/core/root.c                        |    3 +
 drivers/pwm/Kconfig                        |    7 +
 drivers/pwm/Makefile                       |    1 +
 drivers/pwm/pwm-ti-ehrpwm.c                |  468 +++++
 drivers/timer/omap-timer.c                 |    6 +-
 drivers/video/Kconfig                      |    5 +-
 drivers/video/Makefile                     |    2 +-
 drivers/video/ti/Kconfig                   |    8 +
 drivers/video/ti/Makefile                  |   10 +
 drivers/video/{ => ti}/am335x-fb.c         |  342 +---
 drivers/video/{ => ti}/am335x-fb.h         |    4 -
 drivers/video/ti/tilcdc-panel.c            |  172 ++
 drivers/video/ti/tilcdc-panel.h            |   14 +
 drivers/video/ti/tilcdc.c                  |  425 +++++
 drivers/video/ti/tilcdc.h                  |   38 +
 include/asm-generic/global_data.h          |   18 +
 include/clk-uclass.h                       |    8 +
 include/clk.h                              |   28 +
 include/dm/read.h                          |   24 +
 include/dt-bindings/bus/ti-sysc.h          |    6 +
 include/linux/clk-provider.h               |   57 +
 test/dm/clk.c                              |   22 +
 test/dm/test-fdt.c                         |  149 +-
 86 files changed, 5670 insertions(+), 969 deletions(-)
 create mode 100644 arch/arm/dts/am33xx-l4.dtsi
 create mode 100644 drivers/bus/ti-pwmss.c
 create mode 100644 drivers/bus/ti-sysc.c
 create mode 100644 drivers/clk/ti/Kconfig
 create mode 100644 drivers/clk/ti/Makefile
 create mode 100644 drivers/clk/ti/clk-am3-dpll-x2.c
 create mode 100644 drivers/clk/ti/clk-am3-dpll.c
 create mode 100644 drivers/clk/ti/clk-ctrl.c
 create mode 100644 drivers/clk/ti/clk-divider.c
 create mode 100644 drivers/clk/ti/clk-gate.c
 create mode 100644 drivers/clk/ti/clk-mux.c
 rename drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} (100%)
 create mode 100644 drivers/clk/ti/clk.c
 create mode 100644 drivers/clk/ti/clk.h
 create mode 100644 drivers/clk/ti/omap4-cm.c
 create mode 100644 drivers/pwm/pwm-ti-ehrpwm.c
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 rename drivers/video/{ => ti}/am335x-fb.c (54%)
 rename drivers/video/{ => ti}/am335x-fb.h (97%)
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
Signature · 1 line
2.17.1
#1 lore raw

PATCH v6 1/28 clk: export generic routines

Export routines that can be used by other drivers avoiding duplicating code.

---

(no changes since v2)

Changes in v2:
- Add the clk_ prefix to the divider functions.
- Add kernel-doc comments to the exported functions.

 drivers/clk/clk-divider.c    | 24 +++++++--------
 include/linux/clk-provider.h | 57 ++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 12 deletions(-)
drivers/clk/clk-divider.c +12 -12
index 8f59d7fb72..9df50a5e72 100644
@@ -28,8 +28,8 @@
 
 #define UBOOT_DM_CLK_CCF_DIVIDER "ccf_clk_divider"
 
-static unsigned int _get_table_div(const struct clk_div_table *table,
-				   unsigned int val)
+unsigned int clk_divider_get_table_div(const struct clk_div_table *table,
+				       unsigned int val)
 {
 	const struct clk_div_table *clkt;
 
@@ -49,7 +49,7 @@ static unsigned int _get_div(const struct clk_div_table *table,
 	if (flags & CLK_DIVIDER_MAX_AT_ZERO)
 		return val ? val : clk_div_mask(width) + 1;
 	if (table)
-		return _get_table_div(table, val);
+		return clk_divider_get_table_div(table, val);
 	return val + 1;
 }
 
@@ -89,8 +89,8 @@ static ulong clk_divider_recalc_rate(struct clk *clk)
 				   divider->flags, divider->width);
 }
 
-static bool _is_valid_table_div(const struct clk_div_table *table,
-				unsigned int div)
+bool clk_divider_is_valid_table_div(const struct clk_div_table *table,
+				    unsigned int div)
 {
 	const struct clk_div_table *clkt;
 
@@ -100,18 +100,18 @@ static bool _is_valid_table_div(const struct clk_div_table *table,
 	return false;
 }
 
-static bool _is_valid_div(const struct clk_div_table *table, unsigned int div,
-			  unsigned long flags)
+bool clk_divider_is_valid_div(const struct clk_div_table *table,
+			      unsigned int div, unsigned long flags)
 {
 	if (flags & CLK_DIVIDER_POWER_OF_TWO)
 		return is_power_of_2(div);
 	if (table)
-		return _is_valid_table_div(table, div);
+		return clk_divider_is_valid_table_div(table, div);
 	return true;
 }
 
-static unsigned int _get_table_val(const struct clk_div_table *table,
-				   unsigned int div)
+unsigned int clk_divider_get_table_val(const struct clk_div_table *table,
+				       unsigned int div)
 {
 	const struct clk_div_table *clkt;
 
@@ -131,7 +131,7 @@ static unsigned int _get_val(const struct clk_div_table *table,
 	if (flags & CLK_DIVIDER_MAX_AT_ZERO)
 		return (div == clk_div_mask(width) + 1) ? 0 : div;
 	if (table)
-		return  _get_table_val(table, div);
+		return clk_divider_get_table_val(table, div);
 	return div - 1;
 }
 int divider_get_val(unsigned long rate, unsigned long parent_rate,
@@ -142,7 +142,7 @@ int divider_get_val(unsigned long rate, unsigned long parent_rate,
 
 	div = DIV_ROUND_UP_ULL((u64)parent_rate, rate);
 
-	if (!_is_valid_div(table, div, flags))
+	if (!clk_divider_is_valid_div(table, div, flags))
 		return -EINVAL;
 
 	value = _get_val(table, div, flags, width);
include/linux/clk-provider.h +57 -0

69 lines not on this page · raw message

Signature · 1 line
2.17.1
#2 lore raw

PATCH v6 2/28 dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7

In reply to Dario Binacchi

Add support for PRUSS SYSC type:
The PRUSS module has a SYSCFG which is unique. The SYSCFG has two additional unique fields called STANDBY_INIT and SUB_MWAIT in addition to regular IDLE_MODE and STANDBY_MODE fields. Add the bindings for this new sysc type.

Add support for MCAN on dra76x:
The dra76x MCAN generic interconnect module has a its own format for the bits in the control registers.

---

(no changes since v1)

 include/dt-bindings/bus/ti-sysc.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/dt-bindings/bus/ti-sysc.h +6 -0
index 2c005376ac..eae4274543 100644
@@ -15,6 +15,12 @@
 /* SmartReflex sysc found on 36xx and later */
 #define SYSC_OMAP3_SR_ENAWAKEUP		(1 << 26)
 
+#define SYSC_DRA7_MCAN_ENAWAKEUP	(1 << 4)
+
+/* PRUSS sysc found on AM33xx/AM43xx/AM57xx */
+#define SYSC_PRUSS_SUB_MWAIT		(1 << 5)
+#define SYSC_PRUSS_STANDBY_INIT		(1 << 4)
+
 /* SYSCONFIG STANDBYMODE/MIDLEMODE/SIDLEMODE supported by hardware */
 #define SYSC_IDLE_FORCE			0
 #define SYSC_IDLE_NO			1
Signature · 1 line
2.17.1
#3 lore raw

PATCH v6 3/28 bus: ti: add minimal sysc interconnect target driver

In reply to Dario Binacchi

We can handle the sysc interconnect target module in a generic way for many TI SoCs. Initially let's just enable domain clocks before the children are probed.

The code is loosely based on the drivers/bus/ti-sysc.c of the Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/bus/ti-sysc.txt

---

(no changes since v4)

Changes in v4:
- Include device_compat.h header for dev_xxx macros.

 arch/arm/Kconfig      |   1 +
 drivers/bus/Kconfig   |   7 ++
 drivers/bus/Makefile  |   1 +
 drivers/bus/ti-sysc.c | 166 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 175 insertions(+)
 create mode 100644 drivers/bus/ti-sysc.c
arch/arm/Kconfig +1 -0
index 5903c09370..4cc2c242d1 100644
@@ -799,6 +799,7 @@ config ARCH_OMAP2PLUS
 	select SPL_BOARD_INIT if SPL
 	select SPL_STACK_R if SPL
 	select SUPPORT_SPL
+	select TI_SYSC
 	imply FIT
 
 config ARCH_MESON
drivers/bus/Kconfig +7 -0
index 07a33c6287..733bec5a56 100644
@@ -5,6 +5,13 @@
 
 menu "Bus devices"
 
+config TI_SYSC
+	bool "TI sysc interconnect target module driver"
+	depends on ARCH_OMAP2PLUS
+	help
+	  Generic driver for Texas Instruments interconnect target module
+	  found on many TI SoCs.
+
 config UNIPHIER_SYSTEM_BUS
 	bool "UniPhier System Bus driver"
 	depends on ARCH_UNIPHIER
drivers/bus/Makefile +1 -0
index 0b97fc1f8b..875bb4ed42 100644
@@ -3,4 +3,5 @@
 # Makefile for the bus drivers.
 #
 
+obj-$(CONFIG_TI_SYSC)	+= ti-sysc.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o
drivers/bus/ti-sysc.c new file +166 -0

166 lines not on this page · raw message

Signature · 1 line
2.17.1
#4 lore raw

PATCH v6 3/28 bus: ti: add minimal sysc interconnect target driver

Quoted 30 lines · Dario Binacchi

We can handle the sysc interconnect target module in a generic way for many TI SoCs. Initially let's just enable domain clocks before the children are probed.

The code is loosely based on the drivers/bus/ti-sysc.c of the Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/bus/ti-sysc.txt

---

(no changes since v4)

Changes in v4:
- Include device_compat.h header for dev_xxx macros.

 arch/arm/Kconfig      |   1 +
 drivers/bus/Kconfig   |   7 ++
 drivers/bus/Makefile  |   1 +
 drivers/bus/ti-sysc.c | 166 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 175 insertions(+)
 create mode 100644 drivers/bus/ti-sysc.c
arch/arm/Kconfig +0 -0
index 5903c09370..4cc2c242d1 100644

arch/arm/Kconfig config ARCH_OMAP2PLUS · line 802

Quoted 4 lines
arch/arm/Kconfig +1 -0
@@ -799,6 +799,7 @@ config ARCH_OMAP2PLUS
 	select SPL_BOARD_INIT if SPL
 	select SPL_STACK_R if SPL
 	select SUPPORT_SPL
+	select TI_SYSC

Not all OMAP2 platform need TI_SYSC. With this change nokia builds are failing. I will make this as imply and disable it in Nokia config.

Thanks and regards,
Lokesh

Quoted 204 lines
arch/arm/Kconfig +0 -0
 	imply FIT
 
 config ARCH_MESON
drivers/bus/Kconfig +7 -0
index 07a33c6287..733bec5a56 100644
@@ -5,6 +5,13 @@
 
 menu "Bus devices"
 
+config TI_SYSC
+	bool "TI sysc interconnect target module driver"
+	depends on ARCH_OMAP2PLUS
+	help
+	  Generic driver for Texas Instruments interconnect target module
+	  found on many TI SoCs.
+
 config UNIPHIER_SYSTEM_BUS
 	bool "UniPhier System Bus driver"
 	depends on ARCH_UNIPHIER
drivers/bus/Makefile +1 -0
index 0b97fc1f8b..875bb4ed42 100644
@@ -3,4 +3,5 @@
 # Makefile for the bus drivers.
 #
 
+obj-$(CONFIG_TI_SYSC)	+= ti-sysc.o
 obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o
drivers/bus/ti-sysc.c new file +166 -0
new file mode 100644
index 0000000000..65974a70a6
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Texas Instruments sysc interconnect target driver
+ *
+ * Copyright (C) 2020 Dario Binacchi <[email protected]>
+ */
+
+#include <common.h>
+#include <clk.h>
+#include <dm.h>
+#include <dm/device_compat.h>
+
+enum ti_sysc_clocks {
+	TI_SYSC_FCK,
+	TI_SYSC_ICK,
+	TI_SYSC_MAX_CLOCKS,
+};
+
+static const char *const clock_names[] = {"fck", "ick"};
+
+struct ti_sysc_priv {
+	int clocks_count;
+	struct clk clocks[TI_SYSC_MAX_CLOCKS];
+};
+
+static const struct udevice_id ti_sysc_ids[] = {
+	{.compatible = "ti,sysc-omap2"},
+	{.compatible = "ti,sysc-omap4"},
+	{.compatible = "ti,sysc-omap4-simple"},
+	{.compatible = "ti,sysc-omap3430-sr"},
+	{.compatible = "ti,sysc-omap3630-sr"},
+	{.compatible = "ti,sysc-omap4-sr"},
+	{.compatible = "ti,sysc-omap3-sham"},
+	{.compatible = "ti,sysc-omap-aes"},
+	{.compatible = "ti,sysc-mcasp"},
+	{.compatible = "ti,sysc-usb-host-fs"},
+	{}
+};
+
+static int ti_sysc_get_one_clock(struct udevice *dev, enum ti_sysc_clocks index)
+{
+	struct ti_sysc_priv *priv = dev_get_priv(dev);
+	const char *name;
+	int err;
+
+	switch (index) {
+	case TI_SYSC_FCK:
+		break;
+	case TI_SYSC_ICK:
+		break;
+	default:
+		return -EINVAL;
+	}
+
+	name = clock_names[index];
+
+	err = clk_get_by_name(dev, name, &priv->clocks[index]);
+	if (err) {
+		if (err == -ENODATA)
+			return 0;
+
+		dev_err(dev, "failed to get %s clock\n", name);
+		return err;
+	}
+
+	return 0;
+}
+
+static int ti_sysc_put_clocks(struct udevice *dev)
+{
+	struct ti_sysc_priv *priv = dev_get_priv(dev);
+	int err;
+
+	err = clk_release_all(priv->clocks, priv->clocks_count);
+	if (err)
+		dev_err(dev, "failed to release all clocks\n");
+
+	return err;
+}
+
+static int ti_sysc_get_clocks(struct udevice *dev)
+{
+	struct ti_sysc_priv *priv = dev_get_priv(dev);
+	int i, err;
+
+	for (i = 0; i < TI_SYSC_MAX_CLOCKS; i++) {
+		err = ti_sysc_get_one_clock(dev, i);
+		if (!err)
+			priv->clocks_count++;
+		else if (err != -ENOENT)
+			return err;
+	}
+
+	return 0;
+}
+
+static int ti_sysc_child_post_remove(struct udevice *dev)
+{
+	struct ti_sysc_priv *priv = dev_get_priv(dev->parent);
+	int i, err;
+
+	for (i = 0; i < priv->clocks_count; i++) {
+		err = clk_disable(&priv->clocks[i]);
+		if (err) {
+			dev_err(dev->parent, "failed to disable %s clock\n",
+				clock_names[i]);
+			return err;
+		}
+	}
+
+	return 0;
+}
+
+static int ti_sysc_child_pre_probe(struct udevice *dev)
+{
+	struct ti_sysc_priv *priv = dev_get_priv(dev->parent);
+	int i, err;
+
+	for (i = 0; i < priv->clocks_count; i++) {
+		err = clk_enable(&priv->clocks[i]);
+		if (err) {
+			dev_err(dev->parent, "failed to enable %s clock\n",
+				clock_names[i]);
+			return err;
+		}
+	}
+
+	return 0;
+}
+
+static int ti_sysc_remove(struct udevice *dev)
+{
+	return ti_sysc_put_clocks(dev);
+}
+
+static int ti_sysc_probe(struct udevice *dev)
+{
+	int err;
+
+	err = ti_sysc_get_clocks(dev);
+	if (err)
+		goto clocks_err;
+
+	return 0;
+
+clocks_err:
+	ti_sysc_put_clocks(dev);
+	return err;
+}
+
+UCLASS_DRIVER(ti_sysc) = {
+	.id = UCLASS_SIMPLE_BUS,
+	.name = "ti_sysc",
+	.post_bind = dm_scan_fdt_dev
+};
+
+U_BOOT_DRIVER(ti_sysc) = {
+	.name = "ti_sysc",
+	.id = UCLASS_SIMPLE_BUS,
+	.of_match = ti_sysc_ids,
+	.probe = ti_sysc_probe,
+	.remove = ti_sysc_remove,
+	.child_pre_probe = ti_sysc_child_pre_probe,
+	.child_post_remove = ti_sysc_child_post_remove,
+	.priv_auto_alloc_size = sizeof(struct ti_sysc_priv)
+};
#5 lore raw

PATCH v6 4/28 arm: dts: sync am33xx with Linux 5.9-rc7

In reply to Dario Binacchi

There have been several changes to the am33xx.dtsi, so this patch re-syncs it with Linux.

Let's add proper interconnect hierarchy for l4 interconnect instances with the related ti-sysc interconnect module data as documented in Documentation/devicetree/bindings/bus/ti-sysc.txt of the Linux kernel. With l4 interconnect hierarchy and ti-sysc interconnect target module data in place, we can simply move all the related child devices to their proper location and enable probing using ti-sysc.

The am33xx-clock.dtsi file is the same as that of the Linux kernel, except for the reg property of the node l4-wkup-clkctrl at 0. As for the am33xx.dtsi file, all the devices with drivers not yet implemented and those I was able to test with this patch have been moved to am33xx-l4.dtsi. In case of any regressions, problem devices can be reverted by moving them back and removing the related interconnect target module node.

---

(no changes since v4)

Changes in v4:
- Remove a blank line at end of file arch/arm/dts/am33xx-l4.dtsi.

 arch/arm/dts/am335x-draco.dtsi           |   11 +-
 arch/arm/dts/am335x-evm.dts              |    2 +-
 arch/arm/dts/am335x-evmsk.dts            |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi |    5 -
 arch/arm/dts/am335x-pxm2.dtsi            |    2 +-
 arch/arm/dts/am335x-rut.dts              |    2 +-
 arch/arm/dts/am335x-shc.dts              |    2 +-
 arch/arm/dts/am33xx-clocks.dtsi          |  106 +-
 arch/arm/dts/am33xx-l4.dtsi              | 1962 ++++++++++++++++++++++
 arch/arm/dts/am33xx.dtsi                 |  721 +++-----
 10 files changed, 2273 insertions(+), 542 deletions(-)
 create mode 100644 arch/arm/dts/am33xx-l4.dtsi
arch/arm/dts/am335x-draco.dtsi +6 -5
index b38ff55e1d..2c125fcec9 100644
@@ -20,11 +20,6 @@
 	};
 
 	ocp {
-		uart0: serial at 44e09000 {
-			pinctrl-names = "default";
-			pinctrl-0 = <&uart0_pins>;
-			status = "okay";
-		};
 
 		i2c0: i2c at 44e0b000 {
 			pinctrl-names = "default";
@@ -112,6 +107,12 @@
 	status = "disabled";
 };
 
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins>;
+	status = "okay";
+};
+
 &uart4 {
 	status = "disabled";
 };
arch/arm/dts/am335x-evm.dts +1 -1
index 0bda4d4429..07288fb188 100644
@@ -486,7 +486,7 @@
 &epwmss0 {
 	status = "okay";
 
-	ecap0: ecap at 48300100 {
+	ecap0: ecap at 100 {
 		status = "okay";
 		pinctrl-names = "default";
 		pinctrl-0 = <&ecap0_pins>;
arch/arm/dts/am335x-evmsk.dts +1 -1
index 5762967cf7..c94c33b595 100644
@@ -531,7 +531,7 @@
 &epwmss2 {
 	status = "okay";
 
-	ecap2: ecap at 48304100 {
+	ecap2: ecap at 100 {
 		status = "okay";
 		pinctrl-names = "default";
 		pinctrl-0 = <&ecap2_pins>;
arch/arm/dts/am335x-guardian-u-boot.dtsi +0 -5
index 705ef335bf..eae027c541 100644
@@ -26,11 +26,6 @@
 	u-boot,dm-pre-reloc;
 };
 
-&rtc {
-	clocks = <&l4_per_clkctrl AM3_CLKDIV32K_CLKCTRL 0>;
-	clock-names = "int-clk";
-};
-
 &scm {
 	u-boot,dm-pre-reloc;
 };
arch/arm/dts/am335x-pxm2.dtsi +1 -1
index 19bd7e2420..645d221507 100644
@@ -148,7 +148,7 @@
 &epwmss0 {
 	status = "okay";
 
-	ecap0: ecap at 48300100 {
+	ecap0: ecap at 100 {
 		status = "okay";
 		pinctrl-names = "default";
 		pinctrl-0 = <&ecap0_pins>;
arch/arm/dts/am335x-rut.dts +1 -1
index 145247344f..cc06f5d23a 100644
@@ -174,7 +174,7 @@
 &epwmss0 {
 	status = "okay";
 
-	ecap0: ecap at 48300100 {
+	ecap0: ecap at 100 {
 		status = "okay";
 		pinctrl-names = "default";
 		pinctrl-0 = <&ecap0_pins>;
arch/arm/dts/am335x-shc.dts +1 -1
index 8e35c439e5..a41a0606b1 100644
@@ -136,7 +136,7 @@
 &epwmss1 {
 	status = "okay";
 
-	ehrpwm1: pwm at 48302200 {
+	ehrpwm1: pwm at 200 {
 		pinctrl-names = "default";
 		pinctrl-0 = <&ehrpwm1_pins>;
 		status = "okay";
arch/arm/dts/am33xx-clocks.dtsi +80 -26

220 lines not on this page · raw message

arch/arm/dts/am33xx-l4.dtsi new file +1962 -0

1,962 lines not on this page · raw message

arch/arm/dts/am33xx.dtsi +220 -501

744 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.17.1

Part of the diff is not shown here. View the raw message.

#6 lore raw

PATCH v6 5/28 clk: add clk_round_rate()

In reply to Dario Binacchi

It returns the rate which will be set if you ask clk_set_rate() to set that rate. It provides a way to query exactly what rate you'll get if you call clk_set_rate() with that same argument.
So essentially, clk_round_rate() and clk_set_rate() are equivalent except the former does not modify the clock hardware in any way.

---

(no changes since v4)

Changes in v4:
- Update clk_round_rate description.
- Add Sean Anderson review.

 arch/sandbox/include/asm/clk.h |  9 +++++++++
 drivers/clk/clk-uclass.c       | 15 +++++++++++++++
 drivers/clk/clk_sandbox.c      | 17 +++++++++++++++++
 drivers/clk/clk_sandbox_test.c | 10 ++++++++++
 include/clk-uclass.h           |  8 ++++++++
 include/clk.h                  | 28 ++++++++++++++++++++++++++++
 test/dm/clk.c                  | 22 ++++++++++++++++++++++
 7 files changed, 109 insertions(+)
arch/sandbox/include/asm/clk.h +9 -0
index c184c4bffc..0294baee27 100644
@@ -105,6 +105,15 @@ int sandbox_clk_test_get_bulk(struct udevice *dev);
  * @return:	The rate of the clock.
  */
 ulong sandbox_clk_test_get_rate(struct udevice *dev, int id);
+/**
+ * sandbox_clk_test_round_rate - Ask the sandbox clock test device to round a
+ * clock's rate.
+ *
+ * @dev:	The sandbox clock test (client) device.
+ * @id:		The test device's clock ID to configure.
+ * @return:	The rounded rate of the clock.
+ */
+ulong sandbox_clk_test_round_rate(struct udevice *dev, int id, ulong rate);
 /**
  * sandbox_clk_test_set_rate - Ask the sandbox clock test device to set a
  * clock's rate.
drivers/clk/clk-uclass.c +15 -0
index ac954a34d2..3b8e27e4a5 100644
@@ -523,6 +523,21 @@ long long clk_get_parent_rate(struct clk *clk)
 	return pclk->rate;
 }
 
+ulong clk_round_rate(struct clk *clk, ulong rate)
+{
+	const struct clk_ops *ops;
+
+	debug("%s(clk=%p, rate=%lu)\n", __func__, clk, rate);
+	if (!clk_valid(clk))
+		return 0;
+
+	ops = clk_dev_ops(clk->dev);
+	if (!ops->round_rate)
+		return -ENOSYS;
+
+	return ops->round_rate(clk, rate);
+}
+
 ulong clk_set_rate(struct clk *clk, ulong rate)
 {
 	const struct clk_ops *ops;
drivers/clk/clk_sandbox.c +17 -0
index 0ff1b49633..0751e923e7 100644
@@ -30,6 +30,22 @@ static ulong sandbox_clk_get_rate(struct clk *clk)
 	return priv->rate[clk->id];
 }
 
+static ulong sandbox_clk_round_rate(struct clk *clk, ulong rate)
+{
+	struct sandbox_clk_priv *priv = dev_get_priv(clk->dev);
+
+	if (!priv->probed)
+		return -ENODEV;
+
+	if (clk->id >= SANDBOX_CLK_ID_COUNT)
+		return -EINVAL;
+
+	if (!rate)
+		return -EINVAL;
+
+	return rate;
+}
+
 static ulong sandbox_clk_set_rate(struct clk *clk, ulong rate)
 {
 	struct sandbox_clk_priv *priv = dev_get_priv(clk->dev);
@@ -103,6 +119,7 @@ static int sandbox_clk_free(struct clk *clk)
 }
 
 static struct clk_ops sandbox_clk_ops = {
+	.round_rate	= sandbox_clk_round_rate,
 	.get_rate	= sandbox_clk_get_rate,
 	.set_rate	= sandbox_clk_set_rate,
 	.enable		= sandbox_clk_enable,
drivers/clk/clk_sandbox_test.c +10 -0
index 873383856f..f7b77aa674 100644
@@ -86,6 +86,16 @@ ulong sandbox_clk_test_get_rate(struct udevice *dev, int id)
 	return clk_get_rate(sbct->clkps[id]);
 }
 
+ulong sandbox_clk_test_round_rate(struct udevice *dev, int id, ulong rate)
+{
+	struct sandbox_clk_test *sbct = dev_get_priv(dev);
+
+	if (id < 0 || id >= SANDBOX_CLK_TEST_ID_COUNT)
+		return -EINVAL;
+
+	return clk_round_rate(sbct->clkps[id], rate);
+}
+
 ulong sandbox_clk_test_set_rate(struct udevice *dev, int id, ulong rate)
 {
 	struct sandbox_clk_test *sbct = dev_get_priv(dev);
include/clk-uclass.h +8 -0
index dac42dab36..50e8681b55 100644
@@ -61,6 +61,14 @@ struct clk_ops {
 	 * @return 0 if OK, or a negative error code.
 	 */
 	int (*rfree)(struct clk *clock);
+	/**
+	 * round_rate() - Adjust a rate to the exact rate a clock can provide.
+	 *
+	 * @clk:	The clock to manipulate.
+	 * @rate:	Desidered clock rate in Hz.
+	 * @return rounded rate in Hz, or -ve error code.
+	 */
+	ulong (*round_rate)(struct clk *clk, ulong rate);
 	/**
 	 * get_rate() - Get current clock rate.
 	 *
include/clk.h +28 -0
index a62e2efa2c..ca6b85fa6f 100644
@@ -366,6 +366,29 @@ struct clk *clk_get_parent(struct clk *clk);
  */
 long long clk_get_parent_rate(struct clk *clk);
 
+/**
+ * clk_round_rate() - Adjust a rate to the exact rate a clock can provide
+ *
+ * This answers the question "if I were to pass @rate to clk_set_rate(),
+ * what clock rate would I end up with?" without changing the hardware
+ * in any way.  In other words:
+ *
+ *   rate = clk_round_rate(clk, r);
+ *
+ * and:
+ *
+ *   rate = clk_set_rate(clk, r);
+ *
+ * are equivalent except the former does not modify the clock hardware
+ * in any way.
+ *
+ * @clk: A clock struct that was previously successfully requested by
+ *       clk_request/get_by_*().
+ * @rate: desired clock rate in Hz.
+ * @return rounded rate in Hz, or -ve error code.
+ */
+ulong clk_round_rate(struct clk *clk, ulong rate);
+
 /**
  * clk_set_rate() - Set current clock rate.
  *
@@ -482,6 +505,11 @@ static inline long long clk_get_parent_rate(struct clk *clk)
 	return -ENOSYS;
 }
 
+static inline ulong clk_round_rate(struct clk *clk, ulong rate)
+{
+	return -ENOSYS;
+}
+
 static inline ulong clk_set_rate(struct clk *clk, ulong rate)
 {
 	return -ENOSYS;
test/dm/clk.c +22 -0
index edca3b49f6..21997ed892 100644
@@ -112,6 +112,28 @@ static int dm_test_clk(struct unit_test_state *uts)
 	rate = sandbox_clk_test_set_rate(dev_test, SANDBOX_CLK_TEST_ID_I2C, 0);
 	ut_assert(IS_ERR_VALUE(rate));
 
+	ut_asserteq(10000, sandbox_clk_test_get_rate(dev_test,
+						     SANDBOX_CLK_TEST_ID_SPI));
+	ut_asserteq(20000, sandbox_clk_test_get_rate(dev_test,
+						     SANDBOX_CLK_TEST_ID_I2C));
+
+	ut_asserteq(5000, sandbox_clk_test_round_rate(dev_test,
+						      SANDBOX_CLK_TEST_ID_SPI,
+						      5000));
+	ut_asserteq(7000, sandbox_clk_test_round_rate(dev_test,
+						      SANDBOX_CLK_TEST_ID_I2C,
+						      7000));
+
+	ut_asserteq(10000, sandbox_clk_test_get_rate(dev_test,
+						     SANDBOX_CLK_TEST_ID_SPI));
+	ut_asserteq(20000, sandbox_clk_test_get_rate(dev_test,
+						     SANDBOX_CLK_TEST_ID_I2C));
+
+	rate = sandbox_clk_test_round_rate(dev_test, SANDBOX_CLK_TEST_ID_SPI, 0);
+	ut_assert(IS_ERR_VALUE(rate));
+	rate = sandbox_clk_test_round_rate(dev_test, SANDBOX_CLK_TEST_ID_I2C, 0);
+	ut_assert(IS_ERR_VALUE(rate));
+
 	ut_asserteq(10000, sandbox_clk_test_get_rate(dev_test,
 						     SANDBOX_CLK_TEST_ID_SPI));
 	ut_asserteq(20000, sandbox_clk_test_get_rate(dev_test,
Signature · 1 line
2.17.1
#7 lore raw

PATCH v6 6/28 clk: ti: add mux clock driver

In reply to Dario Binacchi

The driver manages a register-mapped multiplexer with multiple input clock signals or parents, one of which can be selected as output. It uses routines provided by the common clock framework (ccf).

The code is based on the drivers/clk/ti/mux.c driver of the Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/mux.txt

---

(no changes since v5)

Changes in v5:
- Create drivers/clk/ti directory.
- Move the clk-ti-mux.c file to drivers/clk/ti and rename it clk-mux.c

Changes in v4:
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/clock-bindings.txt.
- Remove doc/device-tree-bindings/clock/ti,mux.txt.
- Add to commit message the references to linux kernel dt binding documentation.

 drivers/clk/Kconfig      |   1 +
 drivers/clk/Makefile     |   1 +
 drivers/clk/ti/Kconfig   |  10 ++
 drivers/clk/ti/Makefile  |   6 +
 drivers/clk/ti/clk-mux.c | 276 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 294 insertions(+)
 create mode 100644 drivers/clk/ti/Kconfig
 create mode 100644 drivers/clk/ti/Makefile
 create mode 100644 drivers/clk/ti/clk-mux.c
drivers/clk/Kconfig +1 -0
index 4dfbad7986..9e54929039 100644
@@ -179,6 +179,7 @@ source "drivers/clk/renesas/Kconfig"
 source "drivers/clk/sunxi/Kconfig"
 source "drivers/clk/sifive/Kconfig"
 source "drivers/clk/tegra/Kconfig"
+source "drivers/clk/ti/Kconfig"
 source "drivers/clk/uniphier/Kconfig"
 
 config ICS8N3QV01
drivers/clk/Makefile +1 -0
index d1e295ac7c..2581fe0a19 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_$(SPL_TPL_)CLK_COMPOSITE_CCF) += clk-composite.o
 obj-y += analogbits/
 obj-y += imx/
 obj-y += tegra/
+obj-y += ti/
 obj-$(CONFIG_ARCH_ASPEED) += aspeed/
 obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
 obj-$(CONFIG_ARCH_MTMIPS) += mtmips/
drivers/clk/ti/Kconfig new file +10 -0
new file mode 100644
index 0000000000..be4f26817f
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Dario Binacchi <[email protected]>
+#
+
+config CLK_TI_MUX
+	bool "TI mux clock driver"
+	depends on CLK && OF_CONTROL && CLK_CCF
+	help
+	  This enables the mux clock driver support on TI's SoCs.
drivers/clk/ti/Makefile new file +6 -0
new file mode 100644
index 0000000000..5faf68d30e
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2020 Dario Binacchi <[email protected]>
+#
+
+obj-$(CONFIG_CLK_TI_MUX) += clk-mux.o
drivers/clk/ti/clk-mux.c new file +276 -0

276 lines not on this page · raw message

Signature · 1 line
2.17.1
#8 lore raw

PATCH v6 7/28 arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro

In reply to Dario Binacchi

Add missing DPLL_EN_FAST_RELOCK_BYPASS macro. Used to put the DPLL in idle bypass fast relock mode.

---

(no changes since v1)

 arch/arm/include/asm/arch-am33xx/clock.h | 1 +
 1 file changed, 1 insertion(+)
arch/arm/include/asm/arch-am33xx/clock.h +1 -0
index dc7a9b188d..5d775902bb 100644
@@ -66,6 +66,7 @@
 #define DPLL_EN_STOP			1
 #define DPLL_EN_MN_BYPASS		4
 #define DPLL_EN_LOW_POWER_BYPASS	5
+#define DPLL_EN_FAST_RELOCK_BYPASS	6
 #define DPLL_EN_LOCK			7
 
 /* CM_IDLEST_DPLL fields */
Signature · 1 line
2.17.1
#9 lore raw

PATCH v6 8/28 clk: ti: am33xx: add DPLL clock drivers

In reply to Dario Binacchi

The digital phase-locked loop (DPLL) provides all interface clocks and functional clocks to the processor of the AM33xx device. The AM33xx device integrates five different DPLLs:
* Core DPLL
* Per DPLL
* LCD DPLL
* DDR DPLL
* MPU DPLL

The patch adds support for the compatible strings:
* "ti,am3-dpll-core-clock"
* "ti,am3-dpll-no-gate-clock"
* "ti,am3-dpll-no-gate-j-type-clock"
* "ti,am3-dpll-x2-clock"

The code is loosely based on the drivers/clk/ti/dpll.c drivers of the Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/dpll.txt

---

(no changes since v5)

Changes in v5:
- Move the clk-ti-am3-dpll.c file to drivers/clk/ti with the name clk-am3-dpll.c.
- Move the clk-ti-am3-dpll-x2.c file to drivers/clk/ti with the name clk-am3-dpll-x2.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/ti,dpll.txt.
- Add to commit message the references to linux kernel dt binding documentation.

 drivers/clk/ti/Kconfig           |   7 +
 drivers/clk/ti/Makefile          |   1 +
 drivers/clk/ti/clk-am3-dpll-x2.c |  79 +++++++++
 drivers/clk/ti/clk-am3-dpll.c    | 268 +++++++++++++++++++++++++++++++
 4 files changed, 355 insertions(+)
 create mode 100644 drivers/clk/ti/clk-am3-dpll-x2.c
 create mode 100644 drivers/clk/ti/clk-am3-dpll.c
drivers/clk/ti/Kconfig +7 -0
index be4f26817f..c430dd9b8a 100644
@@ -3,6 +3,13 @@
 # Copyright (C) 2020 Dario Binacchi <[email protected]>
 #
 
+config CLK_TI_AM3_DPLL
+	bool "TI AM33XX Digital Phase-Locked Loop (DPLL) clock drivers"
+	depends on CLK && OF_CONTROL
+	help
+	  This enables the DPLL clock drivers support on AM33XX SoCs. The DPLL
+	  provides all interface clocks and functional clocks to the processor.
+
 config CLK_TI_MUX
 	bool "TI mux clock driver"
 	depends on CLK && OF_CONTROL && CLK_CCF
drivers/clk/ti/Makefile +1 -0
index 5faf68d30e..9e14b83cfe 100644
@@ -3,4 +3,5 @@
 # Copyright (C) 2020 Dario Binacchi <[email protected]>
 #
 
+obj-$(CONFIG_CLK_TI_AM3_DPLL) += clk-am3-dpll.o clk-am3-dpll-x2.o
 obj-$(CONFIG_CLK_TI_MUX) += clk-mux.o
drivers/clk/ti/clk-am3-dpll-x2.c new file +79 -0

79 lines not on this page · raw message

drivers/clk/ti/clk-am3-dpll.c new file +268 -0

268 lines not on this page · raw message

Signature · 1 line
2.17.1
#10 lore raw

PATCH v6 9/28 clk: ti: add divider clock driver

In reply to Dario Binacchi

The patch adds support for TI divider clock binding. The driver uses routines provided by the common clock framework (ccf).

The code is based on the drivers/clk/ti/divider.c driver of the Linux kernel version 5.9-rc7.
For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/divider.txt

---

(no changes since v5)

Changes in v5:
- Move the clk-ti.c file to drivers/clk/ti with the name clk.c.
- Move the clk-ti.h file to drivers/clk/ti with the name clk.h.
- Move the clk-ti-divider.c file to drivers/clk/ti with the name clk-divider.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/ti,autoidle.txt.
- Remove doc/device-tree-bindings/clock/ti,divider.txt.
- Add to commit message the references to linux kernel dt binding documentation.

Changes in v2:
- Merged to patch [09/31] clk: ti: refactor mux and divider clock drivers.

 drivers/clk/ti/Kconfig       |   6 +
 drivers/clk/ti/Makefile      |   3 +
 drivers/clk/ti/clk-divider.c | 381 +++++++++++++++++++++++++++++++++++
 drivers/clk/ti/clk-mux.c     |  27 +--
 drivers/clk/ti/clk.c         |  34 ++++
 drivers/clk/ti/clk.h         |  13 ++
 6 files changed, 439 insertions(+), 25 deletions(-)
 create mode 100644 drivers/clk/ti/clk-divider.c
 create mode 100644 drivers/clk/ti/clk.c
 create mode 100644 drivers/clk/ti/clk.h
drivers/clk/ti/Kconfig +6 -0
index c430dd9b8a..87eea86c6f 100644
@@ -10,6 +10,12 @@ config CLK_TI_AM3_DPLL
 	  This enables the DPLL clock drivers support on AM33XX SoCs. The DPLL
 	  provides all interface clocks and functional clocks to the processor.
 
+config CLK_TI_DIVIDER
+	bool "TI divider clock driver"
+	depends on CLK && OF_CONTROL && CLK_CCF
+	help
+	  This enables the divider clock driver support on TI's SoCs.
+
 config CLK_TI_MUX
 	bool "TI mux clock driver"
 	depends on CLK && OF_CONTROL && CLK_CCF
drivers/clk/ti/Makefile +3 -0
index 9e14b83cfe..fd7094cff0 100644
@@ -3,5 +3,8 @@
 # Copyright (C) 2020 Dario Binacchi <[email protected]>
 #
 
+obj-$(CONFIG_ARCH_OMAP2PLUS) += clk.o
+
 obj-$(CONFIG_CLK_TI_AM3_DPLL) += clk-am3-dpll.o clk-am3-dpll-x2.o
+obj-$(CONFIG_CLK_TI_DIVIDER) += clk-divider.o
 obj-$(CONFIG_CLK_TI_MUX) += clk-mux.o
drivers/clk/ti/clk-divider.c new file +381 -0

381 lines not on this page · raw message

drivers/clk/ti/clk-mux.c +2 -25
index 9720c84513..35470255af 100644
@@ -13,6 +13,7 @@
 #include <clk-uclass.h>
 #include <asm/io.h>
 #include <linux/clk-provider.h>
+#include "clk.h"
 
 struct clk_ti_mux_priv {
 	struct clk_bulk parents;
@@ -24,30 +25,6 @@ struct clk_ti_mux_priv {
 	s32 latch;
 };
 
-static void clk_ti_mux_rmw(u32 val, u32 mask, fdt_addr_t reg)
-{
-	u32 v;
-
-	v = readl(reg);
-	v &= ~mask;
-	v |= val;
-	writel(v, reg);
-}
-
-static void clk_ti_mux_latch(fdt_addr_t reg, s8 shift)
-{
-	u32 latch;
-
-	if (shift < 0)
-		return;
-
-	latch = 1 << shift;
-
-	clk_ti_mux_rmw(latch, latch, reg);
-	clk_ti_mux_rmw(0, latch, reg);
-	readl(reg);		/* OCP barrier */
-}
-
 static struct clk *clk_ti_mux_get_parent_by_index(struct clk_bulk *parents,
 						  int index)
 {
@@ -120,7 +97,7 @@ static int clk_ti_mux_set_parent(struct clk *clk, struct clk *parent)
 
 	val |= index << priv->shift;
 	writel(val, priv->reg);
-	clk_ti_mux_latch(priv->reg, priv->latch);
+	clk_ti_latch(priv->reg, priv->latch);
 	return 0;
 }
 
drivers/clk/ti/clk.c new file +34 -0
new file mode 100644
index 0000000000..e44b90ad6a
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * TI clock utilities
+ *
+ * Copyright (C) 2020 Dario Binacchi <[email protected]>
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include "clk.h"
+
+static void clk_ti_rmw(u32 val, u32 mask, fdt_addr_t reg)
+{
+	u32 v;
+
+	v = readl(reg);
+	v &= ~mask;
+	v |= val;
+	writel(v, reg);
+}
+
+void clk_ti_latch(fdt_addr_t reg, s8 shift)
+{
+	u32 latch;
+
+	if (shift < 0)
+		return;
+
+	latch = 1 << shift;
+
+	clk_ti_rmw(latch, latch, reg);
+	clk_ti_rmw(0, latch, reg);
+	readl(reg);		/* OCP barrier */
+}
drivers/clk/ti/clk.h new file +13 -0
new file mode 100644
index 0000000000..601c3823f7
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * TI clock utilities header
+ *
+ * Copyright (C) 2020 Dario Binacchi <[email protected]>
+ */
+
+#ifndef _CLK_TI_H
+#define _CLK_TI_H
+
+void clk_ti_latch(fdt_addr_t reg, s8 shift);
+
+#endif /* #ifndef _CLK_TI_H */
Signature · 1 line
2.17.1
#11 lore raw

PATCH v6 10/28 clk: ti: add gate clock driver

In reply to Dario Binacchi

The patch adds support for TI gate clock binding. The code is based on the drivers/clk/ti/gate.c driver of the Linux kernel version 5.9-rc7. For DT binding details see:
- Documentation/devicetree/bindings/clock/ti/gate.txt

---

(no changes since v5)

Changes in v5:
- Move the clk-ti-gate.c file to drivers/clk/ti with the name clk-gate.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/gpio-gate-clock.txt.
- Remove doc/device-tree-bindings/clock/ti,clockdomain.txt.
- Remove doc/device-tree-bindings/clock/ti,gate.txt.
- Add to commit message the references to linux kernel dt binding documentation.

 drivers/clk/ti/Kconfig    |  6 +++
 drivers/clk/ti/Makefile   |  1 +
 drivers/clk/ti/clk-gate.c | 93 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 100 insertions(+)
 create mode 100644 drivers/clk/ti/clk-gate.c
drivers/clk/ti/Kconfig +6 -0
index 87eea86c6f..30959a316a 100644
@@ -16,6 +16,12 @@ config CLK_TI_DIVIDER
 	help
 	  This enables the divider clock driver support on TI's SoCs.
 
+config CLK_TI_GATE
+	bool "TI gate clock driver"
+	depends on CLK && OF_CONTROL
+	help
+	  This enables the gate clock driver support on TI's SoCs.
+
 config CLK_TI_MUX
 	bool "TI mux clock driver"
 	depends on CLK && OF_CONTROL && CLK_CCF
drivers/clk/ti/Makefile +1 -0
index fd7094cff0..f8aa735c83 100644
@@ -7,4 +7,5 @@ obj-$(CONFIG_ARCH_OMAP2PLUS) += clk.o
 
 obj-$(CONFIG_CLK_TI_AM3_DPLL) += clk-am3-dpll.o clk-am3-dpll-x2.o
 obj-$(CONFIG_CLK_TI_DIVIDER) += clk-divider.o
+obj-$(CONFIG_CLK_TI_GATE) += clk-gate.o
 obj-$(CONFIG_CLK_TI_MUX) += clk-mux.o
drivers/clk/ti/clk-gate.c new file +93 -0

93 lines not on this page · raw message

Signature · 1 line
2.17.1
#12 lore raw

PATCH v6 11/28 arm: dts: am335x: include am33xx-u-boot.dtsi

In reply to Dario Binacchi

Include the SoC U-boot DTS in each am335x-<board>-u-boot.dtsi.

---

(no changes since v1)

 arch/arm/dts/am335x-chiliboard-u-boot.dtsi | 2 ++
 arch/arm/dts/am335x-evm-u-boot.dtsi        | 2 ++
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      | 2 ++
 arch/arm/dts/am335x-guardian-u-boot.dtsi   | 2 ++
 arch/arm/dts/am335x-icev2-u-boot.dtsi      | 3 +++
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     | 2 ++
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      | 2 ++
 arch/arm/dts/am335x-regor-rdk-u-boot.dtsi  | 2 ++
 arch/arm/dts/am335x-rut-u-boot.dtsi        | 2 ++
 arch/arm/dts/am335x-shc-u-boot.dtsi        | 2 ++
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi   | 2 ++
 11 files changed, 23 insertions(+)
arch/arm/dts/am335x-chiliboard-u-boot.dtsi +2 -0
index 4f9d308039..06a13872ee 100644
@@ -4,6 +4,8 @@
  * Author: Marcin Niestroj <[email protected]>
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	chosen {
 		stdout-path = &uart0;
arch/arm/dts/am335x-evm-u-boot.dtsi +2 -0
index d7b049ef20..400a1d2cec 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	panel {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-evmsk-u-boot.dtsi +2 -0
index 599fb377e6..96798330b1 100644
@@ -5,6 +5,8 @@
  * Copyright (C) 2020 Dario Binacchi <[email protected]>
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	panel {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-guardian-u-boot.dtsi +2 -0
index eae027c541..c866ce83f3 100644
@@ -4,6 +4,8 @@
  * Copyright (C) 2018 Robert Bosch Power Tools GmbH
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	ocp {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-icev2-u-boot.dtsi +3 -0
index cc9569af03..67bfac916e 100644
@@ -2,6 +2,9 @@
 /*
  * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/
  */
+
+#include "am33xx-u-boot.dtsi"
+
 / {
 	xtal25mhz: xtal25mhz {
 		compatible = "fixed-clock";
arch/arm/dts/am335x-pdu001-u-boot.dtsi +2 -0
index a799fe9bc3..4f4fc411f9 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2018 EETS GmbH - https://www.eets.ch/
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	ocp {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-pxm50-u-boot.dtsi +2 -0
index 77dfe6e262..65ed948c58 100644
@@ -5,6 +5,8 @@
  * Copyright (C) 2020 Dario Binacchi <[email protected]>
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	panel {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-regor-rdk-u-boot.dtsi +2 -0
index 1ddd715875..4052d0ee21 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2020 Linumiz
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	chosen {
 		#address-cells = <1>;
arch/arm/dts/am335x-rut-u-boot.dtsi +2 -0
index b2b4aa596a..b16f75a764 100644
@@ -5,6 +5,8 @@
  * Copyright (C) 2020 Dario Binacchi <[email protected]>
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	panel {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-shc-u-boot.dtsi +2 -0
index 2975839ea7..359ae05209 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 Heiko Schocher <[email protected]>
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	ocp {
 		u-boot,dm-pre-reloc;
arch/arm/dts/am335x-wega-rdk-u-boot.dtsi +2 -0
index 634f1b0712..28fd62e231 100644
@@ -3,6 +3,8 @@
  * Copyright (C) 2019 DENX Software Engineering GmbH
  */
 
+#include "am33xx-u-boot.dtsi"
+
 / {
 	chosen {
 		#address-cells = <1>;
Signature · 1 line
2.17.1
#13 lore raw

PATCH v6 12/28 ti: am33xx: fix do_enable_clocks() to accept NULL parameters

In reply to Dario Binacchi

Up till this commit passing NULL as input parameter was allowed, but not handled properly. When a NULL parameter was passed to the function a data abort was raised.

---

(no changes since v1)

 arch/arm/mach-omap2/am33xx/clock.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
arch/arm/mach-omap2/am33xx/clock.c +6 -4
index 8819062aaa..130ee6c6e3 100644
@@ -194,13 +194,14 @@ void do_enable_clocks(u32 *const *clk_domains,
 	u32 i, max = 100;
 
 	/* Put the clock domains in SW_WKUP mode */
-	for (i = 0; (i < max) && clk_domains[i]; i++) {
+	for (i = 0; (i < max) && clk_domains && clk_domains[i]; i++) {
 		enable_clock_domain(clk_domains[i],
 				    CD_CLKCTRL_CLKTRCTRL_SW_WKUP);
 	}
 
 	/* Clock modules that need to be put in SW_EXPLICIT_EN mode */
-	for (i = 0; (i < max) && clk_modules_explicit_en[i]; i++) {
+	for (i = 0; (i < max) && clk_modules_explicit_en &&
+	     clk_modules_explicit_en[i]; i++) {
 		enable_clock_module(clk_modules_explicit_en[i],
 				    MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN,
 				    wait_for_enable);
@@ -215,12 +216,13 @@ void do_disable_clocks(u32 *const *clk_domains,
 
 
 	/* Clock modules that need to be put in SW_DISABLE */
-	for (i = 0; (i < max) && clk_modules_disable[i]; i++)
+	for (i = 0; (i < max) && clk_modules_disable && clk_modules_disable[i];
+	     i++)
 		disable_clock_module(clk_modules_disable[i],
 				     wait_for_disable);
 
 	/* Put the clock domains in SW_SLEEP mode */
-	for (i = 0; (i < max) && clk_domains[i]; i++)
+	for (i = 0; (i < max) && clk_domains && clk_domains[i]; i++)
 		disable_clock_domain(clk_domains[i]);
 }
 
Signature · 1 line
2.17.1
#14 lore raw

PATCH v6 13/28 clk: ti: add support for clkctrl clocks

In reply to Dario Binacchi

Until now the clkctrl clocks have been enabled/disabled through platform routines. Thanks to this patch they can be enabled and configured directly by the probed devices that need to use them.

For DT binding details see Linux doc:
- Documentation/devicetree/bindings/clock/ti-clkctrl.txt

---

(no changes since v5)

Changes in v5:
- Move the clk-ti-ctrl.c file to drivers/clk/ti with the name clk-ctrl.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.

Changes in v3:
- Fix access to registers listed by device tree following resync of am33xx-clock.dtsi with Linux 5.9-rc7.
- Remove doc/device-tree-bindings/clock/ti,clkctrl.txt.
- Add to commit message the references to linux kernel dt binding documentation.

 drivers/clk/ti/Kconfig    |   6 ++
 drivers/clk/ti/Makefile   |   1 +
 drivers/clk/ti/clk-ctrl.c | 154 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 161 insertions(+)
 create mode 100644 drivers/clk/ti/clk-ctrl.c
drivers/clk/ti/Kconfig +6 -0
index 30959a316a..9e257a2eb7 100644
@@ -10,6 +10,12 @@ config CLK_TI_AM3_DPLL
 	  This enables the DPLL clock drivers support on AM33XX SoCs. The DPLL
 	  provides all interface clocks and functional clocks to the processor.
 
+config CLK_TI_CTRL
+	bool "TI OMAP4 clock controller"
+	depends on CLK && OF_CONTROL
+	help
+	  This enables the clock controller driver support on TI's SoCs.
+
 config CLK_TI_DIVIDER
 	bool "TI divider clock driver"
 	depends on CLK && OF_CONTROL && CLK_CCF
drivers/clk/ti/Makefile +1 -0
index f8aa735c83..ed45f18311 100644
@@ -6,6 +6,7 @@
 obj-$(CONFIG_ARCH_OMAP2PLUS) += clk.o
 
 obj-$(CONFIG_CLK_TI_AM3_DPLL) += clk-am3-dpll.o clk-am3-dpll-x2.o
+obj-$(CONFIG_CLK_TI_CTRL) += clk-ctrl.o
 obj-$(CONFIG_CLK_TI_DIVIDER) += clk-divider.o
 obj-$(CONFIG_CLK_TI_GATE) += clk-gate.o
 obj-$(CONFIG_CLK_TI_MUX) += clk-mux.o
drivers/clk/ti/clk-ctrl.c new file +154 -0

154 lines not on this page · raw message

Signature · 1 line
2.17.1
#15 lore raw

PATCH v6 14/28 clk: ti: omap4: add clock manager driver

In reply to Dario Binacchi

This minimal driver is only used to bind child devices.

For DT binding details see Linux doc:
- Documentation/devicetree/bindings/arm/omap/prcm.txt

---

(no changes since v3)

Changes in v3:
- doc/device-tree-bindings/arm/omap,prcm.txt.
- Add to commit message the references to linux kernel dt binding documentation.

 drivers/clk/ti/Makefile   |  2 +-
 drivers/clk/ti/omap4-cm.c | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/ti/omap4-cm.c
drivers/clk/ti/Makefile +1 -1
index ed45f18311..dbd343069c 100644
@@ -3,7 +3,7 @@
 # Copyright (C) 2020 Dario Binacchi <[email protected]>
 #
 
-obj-$(CONFIG_ARCH_OMAP2PLUS) += clk.o
+obj-$(CONFIG_ARCH_OMAP2PLUS) += clk.o omap4-cm.o
 
 obj-$(CONFIG_CLK_TI_AM3_DPLL) += clk-am3-dpll.o clk-am3-dpll-x2.o
 obj-$(CONFIG_CLK_TI_CTRL) += clk-ctrl.o
drivers/clk/ti/omap4-cm.c new file +22 -0
new file mode 100644
index 0000000000..3cdc9b2888
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * OMAP4 clock manager (cm)
+ *
+ * Copyright (C) 2020 Dario Binacchi <[email protected]>
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <dm/lists.h>
+
+static const struct udevice_id ti_omap4_cm_ids[] = {
+	{.compatible = "ti,omap4-cm"},
+	{}
+};
+
+U_BOOT_DRIVER(ti_omap4_cm) = {
+	.name = "ti_omap4_cm",
+	.id = UCLASS_SIMPLE_BUS,
+	.of_match = ti_omap4_cm_ids,
+	.bind = dm_scan_fdt_dev,
+};
Signature · 1 line
2.17.1
#16 lore raw

PATCH v6 15/28 arm: dts: am335x: enable prcm_clocks auto binding

In reply to Dario Binacchi

Adding the 'simple-bus' compatible string to the prcm_clocks node will allow its automatic binding.

---

Changes in v6:
- Remove the 'am3-prcm' driver.
- Add the 'simple-bus' compatible string to the prcm_clocks node.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Add to commit message the references to linux kernel dt binding documentation.

Changes in v2:
- Remove the 'ti_am3_prcm_clocks' driver. Handle 'prcm_clocks' node in the 'ti_am3_prcm' driver.
- Update the commit message.

 arch/arm/dts/am33xx-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/am33xx-u-boot.dtsi +4 -0
index 78f5e2c4d3..2426ece680 100644
@@ -9,3 +9,7 @@
 		u-boot,dm-pre-reloc;
 	};
 };
+
+&prcm_clocks {
+	compatible = "simple-bus";
+};
Signature · 1 line
2.17.1
#17 lore raw

PATCH v6 16/28 clk: move clk-ti-sci driver to 'ti' directory

In reply to Dario Binacchi

The patch moves the clk-ti-sci.c file to the 'ti' directory along with all the other TI's drivers, and renames it clk-sci.c.

---

(no changes since v1)

 drivers/clk/Kconfig                        | 8 --------
 drivers/clk/Makefile                       | 1 -
 drivers/clk/ti/Kconfig                     | 8 ++++++++
 drivers/clk/ti/Makefile                    | 1 +
 drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} | 0
 5 files changed, 9 insertions(+), 9 deletions(-)
 rename drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} (100%)
drivers/clk/Kconfig +0 -8
index 9e54929039..db06f276ec 100644
@@ -98,14 +98,6 @@ config CLK_STM32F
 	  This clock driver adds support for RCC clock management
 	  for STM32F4 and STM32F7 SoCs.
 
-config CLK_TI_SCI
-	bool "TI System Control Interface (TI SCI) clock driver"
-	depends on CLK && TI_SCI_PROTOCOL && OF_CONTROL
-	help
-	  This enables the clock driver support over TI System Control Interface
-	  available on some new TI's SoCs. If you wish to use clock resources
-	  managed by the TI System Controller, say Y here. Otherwise, say N.
-
 config CLK_HSDK
 	bool "Enable cgu clock driver for HSDK boards"
 	depends on CLK && TARGET_HSDK
drivers/clk/Makefile +0 -1
index 2581fe0a19..f8383e523d 100644
@@ -48,6 +48,5 @@ obj-$(CONFIG_SANDBOX) += clk_sandbox.o
 obj-$(CONFIG_SANDBOX) += clk_sandbox_test.o
 obj-$(CONFIG_SANDBOX_CLK_CCF) += clk_sandbox_ccf.o
 obj-$(CONFIG_STM32H7) += clk_stm32h7.o
-obj-$(CONFIG_CLK_TI_SCI) += clk-ti-sci.o
 obj-$(CONFIG_CLK_VERSAL) += clk_versal.o
 obj-$(CONFIG_CLK_CDCE9XX) += clk-cdce9xx.o
drivers/clk/ti/Kconfig +8 -0
index 9e257a2eb7..2dc86d44a9 100644
@@ -33,3 +33,11 @@ config CLK_TI_MUX
 	depends on CLK && OF_CONTROL && CLK_CCF
 	help
 	  This enables the mux clock driver support on TI's SoCs.
+
+config CLK_TI_SCI
+	bool "TI System Control Interface (TI SCI) clock driver"
+	depends on CLK && TI_SCI_PROTOCOL && OF_CONTROL
+	help
+	  This enables the clock driver support over TI System Control Interface
+	  available on some new TI's SoCs. If you wish to use clock resources
+	  managed by the TI System Controller, say Y here. Otherwise, say N.
drivers/clk/ti/Makefile +1 -0
index dbd343069c..9f56b47736 100644
@@ -10,3 +10,4 @@ obj-$(CONFIG_CLK_TI_CTRL) += clk-ctrl.o
 obj-$(CONFIG_CLK_TI_DIVIDER) += clk-divider.o
 obj-$(CONFIG_CLK_TI_GATE) += clk-gate.o
 obj-$(CONFIG_CLK_TI_MUX) += clk-mux.o
+obj-$(CONFIG_CLK_TI_SCI) += clk-sci.o
drivers/clk/ti/clk-sci.c renamed from drivers/clk/clk-ti-sci.c +0 -0
similarity index 100%
rename from drivers/clk/clk-ti-sci.c
rename to drivers/clk/ti/clk-sci.c
Signature · 1 line
2.17.1
#18 lore raw

PATCH v6 17/28 fdt: translate address if #size-cells = <0>

In reply to Dario Binacchi

The __of_translate_address routine translates an address from the device tree into a CPU physical address. A note in the description of the routine explains that the crossing of any level with #size-cells = <0> is to be considered an error not by specification but since inherited from IBM. This does not happen for Texas Instruments, or at least for the beaglebone device tree. Without this patch, in fact, the translation into physical addresses of the registers contained in the am33xx-clocks.dtsi nodes would not be possible. They all have a parent with #size-cells = <0>.

The CONFIG_OF_TRANSLATE_ZERO_SIZE_CELLS symbol makes translation possible even in the case of crossing levels with #size-cells = <0>.

The patch acts conservatively on address translation, except for removing a check within the of_translate_one function in the drivers/core/of_addr.c file:

+

        ranges = of_get_property(parent, rprop, &rlen);

- if (ranges == NULL && !of_empty_ranges_quirk(parent)) {
- debug("no ranges; cannot translate\n");
- return 1;
- }

        if (ranges == NULL || rlen == 0) {
                offset = of_read_number(addr, na);
                memset(addr, 0, pna * 4);
		debug("empty ranges; 1:1 translation\n");

There are two reasons:
1 The function of_empty_ranges_quirk always returns false, invalidating
the following if statement in case of null ranges. Therefore one of the two checks is useless.

2 The implementation of the of_translate_one function found in the
common/fdt_support.c file has removed this check while keeping the one about the 1:1 translation.

The patch adds a test and modifies a check for the correctness of an address in the case of enabling translation also for zero size cells. The added test checks translations of addresses generated by nodes of a device tree similar to those you can find in the files am33xx.dtsi and am33xx-clocks.dtsi for which the patch was created.

The patch was also tested on a beaglebone black board. The addresses generated for the registers of the loaded drivers are those specified by the AM335x reference manual.

---

(no changes since v4)

Changes in v4:
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.

Changes in v3:
- Comment dm_flags field in the global_data structure.

Changes in v2:
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.

 arch/sandbox/dts/test.dts         | 21 ++++++++++
 common/fdt_support.c              |  6 ++-
 drivers/core/Kconfig              | 12 ++++++
 drivers/core/fdtaddr.c            |  2 +-
 drivers/core/of_addr.c            | 14 ++-----
 drivers/core/ofnode.c             |  7 +++-
 drivers/core/root.c               |  3 ++
 include/asm-generic/global_data.h | 18 ++++++++
 test/dm/test-fdt.c                | 69 ++++++++++++++++++++++++++++++-
 9 files changed, 136 insertions(+), 16 deletions(-)
arch/sandbox/dts/test.dts +21 -0
index f3b766271d..637d79caf7 100644
@@ -41,6 +41,7 @@
 		fdt-dummy1 = "/translation-test at 8000/dev at 1,100";
 		fdt-dummy2 = "/translation-test at 8000/dev at 2,200";
 		fdt-dummy3 = "/translation-test at 8000/noxlatebus at 3,300/dev at 42";
+		fdt-dummy4 = "/translation-test at 8000/xlatebus at 4,400/devs/dev at 19";
 		usb0 = &usb_0;
 		usb1 = &usb_1;
 		usb2 = &usb_2;
@@ -1061,6 +1062,7 @@
 			  1 0x100 0x9000 0x1000
 			  2 0x200 0xA000 0x1000
 			  3 0x300 0xB000 0x1000
+			  4 0x400 0xC000 0x1000
 			 >;
 
 		dma-ranges = <0 0x000 0x10000000 0x1000
@@ -1097,6 +1099,25 @@
 				reg = <0x42>;
 			};
 		};
+
+		xlatebus at 4,400 {
+			compatible = "sandbox,zero-size-cells-bus";
+			reg = <4 0x400 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 4 0x400 0x1000>;
+
+			devs {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				dev at 19 {
+					compatible = "denx,u-boot-fdt-dummy";
+					reg = <0x19>;
+				};
+			};
+		};
+
 	};
 
 	osd {
common/fdt_support.c +4 -2
index 5ae75df3c6..c817f994ed 100644
@@ -20,6 +20,8 @@
 #include <exports.h>
 #include <fdtdec.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 /**
  * fdt_getprop_u32_default_node - Return a node's property or a default
  *
@@ -996,8 +998,8 @@ void fdt_del_node_and_alias(void *blob, const char *alias)
 /* Max address size we deal with */
 #define OF_MAX_ADDR_CELLS	4
 #define OF_BAD_ADDR	FDT_ADDR_T_NONE
-#define OF_CHECK_COUNTS(na, ns)	((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
-			(ns) > 0)
+#define OF_CHECK_COUNTS(na, ns) (((na) > 0 && (na) <= OF_MAX_ADDR_CELLS) && \
+			 ((ns) > 0 || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0)))
 
 /* Debug utility */
 #ifdef DEBUG
drivers/core/Kconfig +12 -0
index ffae6f9795..c85a685823 100644
@@ -231,6 +231,18 @@ config OF_TRANSLATE
 	  used for the address translation. This function is faster and
 	  smaller in size than fdt_translate_address().
 
+config OF_TRANSLATE_ZERO_SIZE_CELLS
+	bool "Enable translation for zero size cells"
+	depends on OF_TRANSLATE
+	default n
+	help
+	  The routine used to translate an FDT address into a physical CPU
+	  address was developed by IBM. It considers that crossing any level
+	  with #size-cells = <0> makes translation impossible, even if it is
+	  not the way it was specified.
+	  Enabling this option makes translation possible even in the case
+	  of crossing levels with #size-cells = <0>.
+
 config SPL_OF_TRANSLATE
 	bool "Translate addresses using fdt_translate_address in SPL"
 	depends on SPL_DM && SPL_OF_CONTROL
drivers/core/fdtaddr.c +1 -1
index 8b48aa5bc5..51a0093d65 100644
@@ -49,7 +49,7 @@ fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index)
 
 		reg += index * (na + ns);
 
-		if (ns) {
+		if (ns || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0)) {
 			/*
 			 * Use the full-fledged translate function for complex
 			 * bus setups.
drivers/core/of_addr.c +4 -10
index ca34d84922..a590533c8a 100644
@@ -18,7 +18,9 @@
 /* Max address size we deal with */
 #define OF_MAX_ADDR_CELLS	4
 #define OF_CHECK_ADDR_COUNT(na)	((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
-#define OF_CHECK_COUNTS(na, ns)	(OF_CHECK_ADDR_COUNT(na) && (ns) > 0)
+#define OF_CHECK_COUNTS(na, ns)	(OF_CHECK_ADDR_COUNT(na) && \
+				 ((ns) > 0 || \
+				  (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0)))
 
 static struct of_bus *of_match_bus(struct device_node *np);
 
@@ -162,11 +164,6 @@ const __be32 *of_get_address(const struct device_node *dev, int index,
 }
 EXPORT_SYMBOL(of_get_address);
 
-static int of_empty_ranges_quirk(const struct device_node *np)
-{
-	return false;
-}
-
 static int of_translate_one(const struct device_node *parent,
 			    struct of_bus *bus, struct of_bus *pbus,
 			    __be32 *addr, int na, int ns, int pna,
@@ -193,11 +190,8 @@ static int of_translate_one(const struct device_node *parent,
 	 * As far as we know, this damage only exists on Apple machines, so
 	 * This code is only enabled on powerpc. --gcl
 	 */
+
 	ranges = of_get_property(parent, rprop, &rlen);
-	if (ranges == NULL && !of_empty_ranges_quirk(parent)) {
-		debug("no ranges; cannot translate\n");
-		return 1;
-	}
 	if (ranges == NULL || rlen == 0) {
 		offset = of_read_number(addr, na);
 		memset(addr, 0, pna * 4);
drivers/core/ofnode.c +5 -2
index a68076bf35..2d52eaccb0 100644
@@ -304,7 +304,8 @@ fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size)
 
 		ns = of_n_size_cells(ofnode_to_np(node));
 
-		if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0) {
+		if (IS_ENABLED(CONFIG_OF_TRANSLATE) &&
+		    (ns > 0 || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0))) {
 			return of_translate_address(ofnode_to_np(node), prop_val);
 		} else {
 			na = of_n_addr_cells(ofnode_to_np(node));
@@ -678,8 +679,10 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
 		ns = of_n_size_cells(np);
 		*sizep = of_read_number(prop + na, ns);
 
-		if (CONFIG_IS_ENABLED(OF_TRANSLATE) && ns > 0)
+		if (CONFIG_IS_ENABLED(OF_TRANSLATE) &&
+		    (ns > 0 || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0))) {
 			return of_translate_address(np, prop);
+		}
 		else
 			return of_read_number(prop, na);
 	} else {
drivers/core/root.c +3 -0
index 5f10d7a39c..aac1911ecb 100644
@@ -132,6 +132,9 @@ int dm_init(bool of_live)
 {
 	int ret;
 
+	if (IS_ENABLED(CONFIG_OF_TRANSLATE_ZERO_SIZE_CELLS))
+		gd->dm_flags |= GD_DM_FLG_SIZE_CELLS_0;
+
 	if (gd->dm_root) {
 		dm_warn("Virtual root driver already exists!\n");
 		return -EINVAL;
include/asm-generic/global_data.h +18 -0
index 87d827d0f4..9beb8be0e8 100644
@@ -183,6 +183,12 @@ struct global_data {
 	struct global_data *new_gd;
 
 #ifdef CONFIG_DM
+	/**
+	 * @dm_flags: additional flags for Driver Model
+	 *
+	 * See &enum gd_dm_flags
+	 */
+	unsigned long dm_flags;
 	/**
 	 * @dm_root: root instance for Driver Model
 	 */
@@ -549,6 +555,18 @@ enum gd_flags {
 	GD_FLG_SMP_READY = 0x40000,
 };
 
+/**
+ * enum gd_dm_flags - global data flags for Driver Model
+ *
+ * See field dm_flags of &struct global_data.
+ */
+enum gd_dm_flags {
+	/**
+	 * @GD_DM_FLG_SIZE_CELLS_0: Enable #size-cells=<0> translation
+	 */
+	GD_DM_FLG_SIZE_CELLS_0 = 0x00001,
+};
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __ASM_GENERIC_GBL_DATA_H */
test/dm/test-fdt.c +68 -1

91 lines not on this page · raw message

Signature · 1 line
2.17.1
#19 lore raw

PATCH v6 17/28 fdt: translate address if #size-cells = <0>

Quoted 10 lines · Dario Binacchi

The __of_translate_address routine translates an address from the device tree into a CPU physical address. A note in the description of the routine explains that the crossing of any level with #size-cells = <0> is to be considered an error not by specification but since inherited from IBM. This does not happen for Texas Instruments, or at least for the beaglebone device tree. Without this patch, in fact, the translation into physical addresses of the registers contained in the am33xx-clocks.dtsi nodes would not be possible. They all have a parent with #size-cells = <0>.

Quoted 2 lines

The CONFIG_OF_TRANSLATE_ZERO_SIZE_CELLS symbol makes translation possible even in the case of crossing levels with #size-cells = <0>.

Dear Dario,

Thanks for addressing the incorrect assumption in function __of_translate_address().

The chapter "2.3.6 reg" of "Devicetree Specification, Release v0.3" has this sentence:

"If the parent node specifies a value of 0 for #size-cells, the length field in the value of reg shall be omitted."

What I do not understand yet is why we should have a configuration option for something that is explicitely required by the device-tree specification.

Best regards

Heinrich

Quoted 391 lines

The patch acts conservatively on address translation, except for removing a check within the of_translate_one function in the drivers/core/of_addr.c file:

drivers/core/of_addr.c +1 -4
+
         ranges = of_get_property(parent, rprop, &rlen);
-       if (ranges == NULL && !of_empty_ranges_quirk(parent)) {
-               debug("no ranges; cannot translate\n");
-               return 1;
-       }
         if (ranges == NULL || rlen == 0) {
                 offset = of_read_number(addr, na);
                 memset(addr, 0, pna * 4);
		debug("empty ranges; 1:1 translation\n");

There are two reasons:
1 The function of_empty_ranges_quirk always returns false, invalidating
the following if statement in case of null ranges. Therefore one of the two checks is useless.

2 The implementation of the of_translate_one function found in the
common/fdt_support.c file has removed this check while keeping the one about the 1:1 translation.

The patch adds a test and modifies a check for the correctness of an address in the case of enabling translation also for zero size cells. The added test checks translations of addresses generated by nodes of a device tree similar to those you can find in the files am33xx.dtsi and am33xx-clocks.dtsi for which the patch was created.

The patch was also tested on a beaglebone black board. The addresses generated for the registers of the loaded drivers are those specified by the AM335x reference manual.

---

(no changes since v4)

Changes in v4:
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.

Changes in v3:
- Comment dm_flags field in the global_data structure.

Changes in v2:
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.

  arch/sandbox/dts/test.dts         | 21 ++++++++++
  common/fdt_support.c              |  6 ++-
  drivers/core/Kconfig              | 12 ++++++
  drivers/core/fdtaddr.c            |  2 +-
  drivers/core/of_addr.c            | 14 ++-----
  drivers/core/ofnode.c             |  7 +++-
  drivers/core/root.c               |  3 ++
  include/asm-generic/global_data.h | 18 ++++++++
  test/dm/test-fdt.c                | 69 ++++++++++++++++++++++++++++++-
  9 files changed, 136 insertions(+), 16 deletions(-)
arch/sandbox/dts/test.dts +21 -0
index f3b766271d..637d79caf7 100644
@@ -41,6 +41,7 @@
  		fdt-dummy1 = "/translation-test at 8000/dev at 1,100";
  		fdt-dummy2 = "/translation-test at 8000/dev at 2,200";
  		fdt-dummy3 = "/translation-test at 8000/noxlatebus at 3,300/dev at 42";
+		fdt-dummy4 = "/translation-test at 8000/xlatebus at 4,400/devs/dev at 19";
  		usb0 = &usb_0;
  		usb1 = &usb_1;
  		usb2 = &usb_2;
@@ -1061,6 +1062,7 @@
  			  1 0x100 0x9000 0x1000
  			  2 0x200 0xA000 0x1000
  			  3 0x300 0xB000 0x1000
+			  4 0x400 0xC000 0x1000
  			 >;
 
  		dma-ranges = <0 0x000 0x10000000 0x1000
@@ -1097,6 +1099,25 @@
  				reg = <0x42>;
  			};
  		};
+
+		xlatebus at 4,400 {
+			compatible = "sandbox,zero-size-cells-bus";
+			reg = <4 0x400 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+			ranges = <0 4 0x400 0x1000>;
+
+			devs {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				dev at 19 {
+					compatible = "denx,u-boot-fdt-dummy";
+					reg = <0x19>;
+				};
+			};
+		};
+
  	};
 
  	osd {
common/fdt_support.c +4 -2
index 5ae75df3c6..c817f994ed 100644
@@ -20,6 +20,8 @@
  #include <exports.h>
  #include <fdtdec.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
  /**
   * fdt_getprop_u32_default_node - Return a node's property or a default
   *
@@ -996,8 +998,8 @@ void fdt_del_node_and_alias(void *blob, const char *alias)
  /* Max address size we deal with */
  #define OF_MAX_ADDR_CELLS	4
  #define OF_BAD_ADDR	FDT_ADDR_T_NONE
-#define OF_CHECK_COUNTS(na, ns)	((na) > 0 && (na) <= OF_MAX_ADDR_CELLS && \
-			(ns) > 0)
+#define OF_CHECK_COUNTS(na, ns) (((na) > 0 && (na) <= OF_MAX_ADDR_CELLS) && \
+			 ((ns) > 0 || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0)))
 
  /* Debug utility */
  #ifdef DEBUG
drivers/core/Kconfig +12 -0
index ffae6f9795..c85a685823 100644
@@ -231,6 +231,18 @@ config OF_TRANSLATE
  	  used for the address translation. This function is faster and
  	  smaller in size than fdt_translate_address().
 
+config OF_TRANSLATE_ZERO_SIZE_CELLS
+	bool "Enable translation for zero size cells"
+	depends on OF_TRANSLATE
+	default n
+	help
+	  The routine used to translate an FDT address into a physical CPU
+	  address was developed by IBM. It considers that crossing any level
+	  with #size-cells = <0> makes translation impossible, even if it is
+	  not the way it was specified.
+	  Enabling this option makes translation possible even in the case
+	  of crossing levels with #size-cells = <0>.
+
  config SPL_OF_TRANSLATE
  	bool "Translate addresses using fdt_translate_address in SPL"
  	depends on SPL_DM && SPL_OF_CONTROL
drivers/core/fdtaddr.c +1 -1
index 8b48aa5bc5..51a0093d65 100644
@@ -49,7 +49,7 @@ fdt_addr_t devfdt_get_addr_index(const struct udevice *dev, int index)
 
  		reg += index * (na + ns);
 
-		if (ns) {
+		if (ns || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0)) {
  			/*
  			 * Use the full-fledged translate function for complex
  			 * bus setups.
drivers/core/of_addr.c +4 -10
index ca34d84922..a590533c8a 100644
@@ -18,7 +18,9 @@
  /* Max address size we deal with */
  #define OF_MAX_ADDR_CELLS	4
  #define OF_CHECK_ADDR_COUNT(na)	((na) > 0 && (na) <= OF_MAX_ADDR_CELLS)
-#define OF_CHECK_COUNTS(na, ns)	(OF_CHECK_ADDR_COUNT(na) && (ns) > 0)
+#define OF_CHECK_COUNTS(na, ns)	(OF_CHECK_ADDR_COUNT(na) && \
+				 ((ns) > 0 || \
+				  (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0)))
 
  static struct of_bus *of_match_bus(struct device_node *np);
 
@@ -162,11 +164,6 @@ const __be32 *of_get_address(const struct device_node *dev, int index,
  }
  EXPORT_SYMBOL(of_get_address);
 
-static int of_empty_ranges_quirk(const struct device_node *np)
-{
-	return false;
-}
-
  static int of_translate_one(const struct device_node *parent,
  			    struct of_bus *bus, struct of_bus *pbus,
  			    __be32 *addr, int na, int ns, int pna,
@@ -193,11 +190,8 @@ static int of_translate_one(const struct device_node *parent,
  	 * As far as we know, this damage only exists on Apple machines, so
  	 * This code is only enabled on powerpc. --gcl
  	 */
+
  	ranges = of_get_property(parent, rprop, &rlen);
-	if (ranges == NULL && !of_empty_ranges_quirk(parent)) {
-		debug("no ranges; cannot translate\n");
-		return 1;
-	}
  	if (ranges == NULL || rlen == 0) {
  		offset = of_read_number(addr, na);
  		memset(addr, 0, pna * 4);
drivers/core/ofnode.c +5 -2
index a68076bf35..2d52eaccb0 100644
@@ -304,7 +304,8 @@ fdt_addr_t ofnode_get_addr_size_index(ofnode node, int index, fdt_size_t *size)
 
  		ns = of_n_size_cells(ofnode_to_np(node));
 
-		if (IS_ENABLED(CONFIG_OF_TRANSLATE) && ns > 0) {
+		if (IS_ENABLED(CONFIG_OF_TRANSLATE) &&
+		    (ns > 0 || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0))) {
  			return of_translate_address(ofnode_to_np(node), prop_val);
  		} else {
  			na = of_n_addr_cells(ofnode_to_np(node));
@@ -678,8 +679,10 @@ fdt_addr_t ofnode_get_addr_size(ofnode node, const char *property,
  		ns = of_n_size_cells(np);
  		*sizep = of_read_number(prop + na, ns);
 
-		if (CONFIG_IS_ENABLED(OF_TRANSLATE) && ns > 0)
+		if (CONFIG_IS_ENABLED(OF_TRANSLATE) &&
+		    (ns > 0 || (gd->dm_flags & GD_DM_FLG_SIZE_CELLS_0))) {
  			return of_translate_address(np, prop);
+		}
  		else
  			return of_read_number(prop, na);
  	} else {
drivers/core/root.c +3 -0
index 5f10d7a39c..aac1911ecb 100644
@@ -132,6 +132,9 @@ int dm_init(bool of_live)
  {
  	int ret;
 
+	if (IS_ENABLED(CONFIG_OF_TRANSLATE_ZERO_SIZE_CELLS))
+		gd->dm_flags |= GD_DM_FLG_SIZE_CELLS_0;
+
  	if (gd->dm_root) {
  		dm_warn("Virtual root driver already exists!\n");
  		return -EINVAL;
include/asm-generic/global_data.h +18 -0
index 87d827d0f4..9beb8be0e8 100644
@@ -183,6 +183,12 @@ struct global_data {
  	struct global_data *new_gd;
 
  #ifdef CONFIG_DM
+	/**
+	 * @dm_flags: additional flags for Driver Model
+	 *
+	 * See &enum gd_dm_flags
+	 */
+	unsigned long dm_flags;
  	/**
  	 * @dm_root: root instance for Driver Model
  	 */
@@ -549,6 +555,18 @@ enum gd_flags {
  	GD_FLG_SMP_READY = 0x40000,
  };
 
+/**
+ * enum gd_dm_flags - global data flags for Driver Model
+ *
+ * See field dm_flags of &struct global_data.
+ */
+enum gd_dm_flags {
+	/**
+	 * @GD_DM_FLG_SIZE_CELLS_0: Enable #size-cells=<0> translation
+	 */
+	GD_DM_FLG_SIZE_CELLS_0 = 0x00001,
+};
+
  #endif /* __ASSEMBLY__ */
 
  #endif /* __ASM_GENERIC_GBL_DATA_H */
test/dm/test-fdt.c +68 -1
index cc12419ea0..dd18160cbe 100644
@@ -5,6 +5,7 @@
 
  #include <common.h>
  #include <dm.h>
+#include <dm/device_compat.h>
  #include <errno.h>
  #include <fdtdec.h>
  #include <log.h>
@@ -581,6 +582,64 @@ U_BOOT_DRIVER(fdt_dummy_drv) = {
  	.id	= UCLASS_TEST_DUMMY,
  };
 
+static int zero_size_cells_bus_bind(struct udevice *dev)
+{
+	ofnode child;
+	int err;
+
+	ofnode_for_each_subnode(child, dev_ofnode(dev)) {
+		if (ofnode_get_property(child, "compatible", NULL))
+			continue;
+
+		err = device_bind_driver_to_node(dev,
+						 "zero_size_cells_bus_child_drv",
+						 "zero_size_cells_bus_child",
+						 child, NULL);
+		if (err) {
+			dev_err(dev, "%s: failed to bind %s\n", __func__,
+				ofnode_get_name(child));
+			return err;
+		}
+	}
+
+	return 0;
+}
+
+static const struct udevice_id zero_size_cells_bus_ids[] = {
+	{ .compatible = "sandbox,zero-size-cells-bus" },
+	{ }
+};
+
+U_BOOT_DRIVER(zero_size_cells_bus) = {
+	.name = "zero_size_cells_bus_drv",
+	.id = UCLASS_TEST_DUMMY,
+	.of_match = zero_size_cells_bus_ids,
+	.bind = zero_size_cells_bus_bind,
+};
+
+static int zero_size_cells_bus_child_bind(struct udevice *dev)
+{
+	ofnode child;
+	int err;
+
+	ofnode_for_each_subnode(child, dev_ofnode(dev)) {
+		err = lists_bind_fdt(dev, child, NULL, false);
+		if (err) {
+			dev_err(dev, "%s: lists_bind_fdt, err=%d\n",
+				__func__, err);
+			return err;
+		}
+	}
+
+	return 0;
+}
+
+U_BOOT_DRIVER(zero_size_cells_bus_child_drv) = {
+	.name = "zero_size_cells_bus_child_drv",
+	.id = UCLASS_TEST_DUMMY,
+	.bind = zero_size_cells_bus_child_bind,
+};
+
  static int dm_test_fdt_translation(struct unit_test_state *uts)
  {
  	struct udevice *dev;
@@ -599,11 +658,19 @@ static int dm_test_fdt_translation(struct unit_test_state *uts)
  	ut_asserteq_str("dev at 2,200", dev->name);
  	ut_asserteq(0xA000, dev_read_addr(dev));
 
-	/* No translation for busses with #size-cells == 0 */
  	ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 3, true, &dev));
  	ut_asserteq_str("dev at 42", dev->name);
+	/* No translation for busses with #size-cells == 0 */
  	ut_asserteq(0x42, dev_read_addr(dev));
 
+	/* Translation for busses with #size-cells == 0 */
+	gd->dm_flags |= GD_DM_FLG_SIZE_CELLS_0;
+	ut_asserteq(0x8042, dev_read_addr(dev));
+	ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 4, true, &dev));
+	ut_asserteq_str("dev at 19", dev->name);
+	ut_asserteq(0xc019, dev_read_addr(dev));
+	gd->dm_flags &= ~GD_DM_FLG_SIZE_CELLS_0;
+
  	/* dma address translation */
  	ut_assertok(uclass_find_device_by_seq(UCLASS_TEST_DUMMY, 0, true, &dev));
  	dma_addr[0] = cpu_to_be32(0);
#20 lore raw

PATCH v6 17/28 fdt: translate address if #size-cells = <0>

In reply to Dario Binacchi
Quoted 72 lines · Dario Binacchi

The __of_translate_address routine translates an address from the device tree into a CPU physical address. A note in the description of the routine explains that the crossing of any level with #size-cells = <0> is to be considered an error not by specification but since inherited from IBM. This does not happen for Texas Instruments, or at least for the beaglebone device tree. Without this patch, in fact, the translation into physical addresses of the registers contained in the am33xx-clocks.dtsi nodes would not be possible. They all have a parent with #size-cells = <0>.

The CONFIG_OF_TRANSLATE_ZERO_SIZE_CELLS symbol makes translation possible even in the case of crossing levels with #size-cells = <0>.

The patch acts conservatively on address translation, except for removing a check within the of_translate_one function in the drivers/core/of_addr.c file:

drivers/core/of_addr.c +1 -4
+
        ranges = of_get_property(parent, rprop, &rlen);
-       if (ranges == NULL && !of_empty_ranges_quirk(parent)) {
-               debug("no ranges; cannot translate\n");
-               return 1;
-       }
        if (ranges == NULL || rlen == 0) {
                offset = of_read_number(addr, na);
                memset(addr, 0, pna * 4);
                debug("empty ranges; 1:1 translation\n");

There are two reasons:
1 The function of_empty_ranges_quirk always returns false, invalidating
the following if statement in case of null ranges. Therefore one of the two checks is useless.

2 The implementation of the of_translate_one function found in the
common/fdt_support.c file has removed this check while keeping the one about the 1:1 translation.

The patch adds a test and modifies a check for the correctness of an address in the case of enabling translation also for zero size cells. The added test checks translations of addresses generated by nodes of a device tree similar to those you can find in the files am33xx.dtsi and am33xx-clocks.dtsi for which the patch was created.

The patch was also tested on a beaglebone black board. The addresses generated for the registers of the loaded drivers are those specified by the AM335x reference manual.

---

(no changes since v4)

Changes in v4:
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.

Changes in v3:
- Comment dm_flags field in the global_data structure.

Changes in v2:
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.

Quoted 10 lines
 arch/sandbox/dts/test.dts         | 21 ++++++++++
 common/fdt_support.c              |  6 ++-
 drivers/core/Kconfig              | 12 ++++++
 drivers/core/fdtaddr.c            |  2 +-
 drivers/core/of_addr.c            | 14 ++-----
 drivers/core/ofnode.c             |  7 +++-
 drivers/core/root.c               |  3 ++
 include/asm-generic/global_data.h | 18 ++++++++
 test/dm/test-fdt.c                | 69 ++++++++++++++++++++++++++++++-
 9 files changed, 136 insertions(+), 16 deletions(-)

Still looks good to me.

#21 lore raw

v6 cover Add DM support for omap PWM backlight

In reply to Dario Binacchi

Hi Dario,

Quoted 27 lines · Dario Binacchi

The series was born from the need to manage the PWM backlight of the display connected to my beaglebone board. To hit the target, I had to develop drivers for PWM management which in turn relied on drivers for managing timers and clocks, all developed according to the driver model. My intention was to use the SoC-specific API only at strictly necessary points in the code. My previous patches for migrating the AM335x display driver to the driver model had required the implementation of additional functions outside the concerns of the driver, (settings for dividing the pixel clock rate, configuring the display DPLL rate, ....) not being able to use the API of the related clock drivers. This series shouldn't have repeated the same kind of mistake. Furthermore, I also wanted to fix that kind of forced choice. Almost everything should have been accessible via the driver model API. In the series there are also some patches that could be submitted separately, but which I have however inserted to avoid applying future patches to incorporate them.
With this last consideration, I hope I have convincingly justified the large number of patches in the series.

The patch enabling address translation into a CPU physical address from device-tree even in case of crossing levels with #size-cells = <0>, is crucial for the series. The previous implementation was unable to perform the address translation required by the am33xx device tree. I tried to apply in a conservative way as few changes as possible and to verify the execution of all the tests already developed, as well as the new ones I added for the new feature.

Quoted 2 lines

The patch series can be cleanly applied to the HEAD of the master which at the time of release points to 12e396303c commit.

Are we waiting for any other reviews? TI part looks good to me. If everything else is reviewed, Ill merge the series.

Please CC me for all the series next time else it is difficult for me to track the comments

Thanks and regards,
Lokesh

Quoted 260 lines

Changes in v6:
- Remove the 'am3-prcm' driver.
- Add the 'simple-bus' compatible string to the prcm_clocks node.
- Remove the 'am3-scm' driver.
- Add the 'simple-bus' compatible string to the scm_clocks node.

Changes in v5:
- Create drivers/clk/ti directory.
- Move the clk-ti-mux.c file to drivers/clk/ti and rename it clk-mux.c
- Move the clk-ti-am3-dpll.c file to drivers/clk/ti with the name clk-am3-dpll.c.
- Move the clk-ti-am3-dpll-x2.c file to drivers/clk/ti with the name clk-am3-dpll-x2.c.
- Move the clk-ti.c file to drivers/clk/ti with the name clk.c.
- Move the clk-ti.h file to drivers/clk/ti with the name clk.h.
- Move the clk-ti-divider.c file to drivers/clk/ti with the name clk-divider.c.
- Move the clk-ti-gate.c file to drivers/clk/ti with the name clk-gate.c.
- Move the clk-ti-ctrl.c file to drivers/clk/ti with the name clk-ctrl.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Remove a blank line at end of file arch/arm/dts/am33xx-l4.dtsi.
- Update clk_round_rate description.
- Add Sean Anderson review.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Simon Glass review.
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/clock-bindings.txt.
- Remove doc/device-tree-bindings/clock/ti,mux.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,dpll.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,autoidle.txt.
- Remove doc/device-tree-bindings/clock/ti,divider.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/gpio-gate-clock.txt.
- Remove doc/device-tree-bindings/clock/ti,clockdomain.txt.
- Remove doc/device-tree-bindings/clock/ti,gate.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Fix access to registers listed by device tree following resync of am33xx-clock.dtsi with Linux 5.9-rc7.
- Remove doc/device-tree-bindings/clock/ti,clkctrl.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- doc/device-tree-bindings/arm/omap,prcm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Add to commit message the references to linux kernel dt binding documentation.
- Comment dm_flags field in the global_data structure.
- Remove doc/device-tree-bindings/arm/omap,ctrl.txt.
- Remove doc/device-tree-bindings/pinctrl/pinctrl-single.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Adds PWM_TI_EHRPWM dependency on ARCH_OMAP2PLUS in Kconfig.
- Add error message in case of invalid address.
- Remove doc/device-tree-bindings/pwm/ti,ehrpwm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Move Kconfig symbol from drivers/pwm to drivers/bus.
- Remove the domain clock reference from the pwmss nodes of the device tree in am33xx.dtsi. The resync of am33xx.dtsi with Linux 5.9-rc7 already contains such references.
- Remove domain clock enabling/disabling. Enabling the domain clock is performed by the sysc interconnect target module driver during the pwm device probing.
- Remove doc/device-tree-bindings/pwm/ti,pwmss.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Update the DTS lcdc node of the am335x boards because of the am33xx.dtsi resynced with Linux 5.9-rc7.
- Remove clock domain enabling/disabling.
- Update the commit message.
- Add clk.h header.
- Fix an error code returned by the probe function.

Changes in v2:
- Add the clk_ prefix to the divider functions.
- Add kernel-doc comments to the exported functions.
- Merged to patch [09/31] clk: ti: refactor mux and divider clock drivers.
- Remove the 'ti_am3_prcm_clocks' driver. Handle 'prcm_clocks' node in the 'ti_am3_prcm' driver.
- Update the commit message.
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.
- Remove the 'ti_am3_scm_clocks' driver. Handle 'scm_clocks' node in the 'ti_am3_scm' driver.
- Update the commit message.

Dario Binacchi (28):
clk: export generic routines
dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7
bus: ti: add minimal sysc interconnect target driver
arm: dts: sync am33xx with Linux 5.9-rc7
clk: add clk_round_rate()
clk: ti: add mux clock driver
arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro
clk: ti: am33xx: add DPLL clock drivers
clk: ti: add divider clock driver
clk: ti: add gate clock driver
arm: dts: am335x: include am33xx-u-boot.dtsi
ti: am33xx: fix do_enable_clocks() to accept NULL parameters
clk: ti: add support for clkctrl clocks
clk: ti: omap4: add clock manager driver
arm: dts: am335x: enable prcm_clocks auto binding
clk: move clk-ti-sci driver to 'ti' directory
fdt: translate address if #size-cells = <0>
omap: timer: fix the rate setting
arm: dts: am335x: enable scm_clocks auto binding
pwm: ti: am33xx: add enhanced pwm driver
bus: ti: am33xx: add pwm subsystem driver
dm: core: add a function to decode display timings
video: omap: add panel driver
video: omap: drop domain clock enabling by SOC api
video: omap: set LCD clock rate through DM API
video: omap: split the legacy code from the DM code
video: omap: move drivers to 'ti' directory
board: ti: am335x-ice: get CDCE913 clock device

 arch/arm/Kconfig                           |    1 +
 arch/arm/dts/am335x-brppt1-mmc.dts         |   17 +-
 arch/arm/dts/am335x-brppt1-nand.dts        |   17 +-
 arch/arm/dts/am335x-brppt1-spi.dts         |   17 +-
 arch/arm/dts/am335x-brsmarc1.dts           |   20 +-
 arch/arm/dts/am335x-brxre1.dts             |   21 +-
 arch/arm/dts/am335x-chiliboard-u-boot.dtsi |    2 +
 arch/arm/dts/am335x-draco.dtsi             |   11 +-
 arch/arm/dts/am335x-evm-u-boot.dtsi        |   17 +-
 arch/arm/dts/am335x-evm.dts                |    2 +-
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-evmsk.dts              |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi   |   25 +-
 arch/arm/dts/am335x-icev2-u-boot.dtsi      |    3 +
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     |   20 +-
 arch/arm/dts/am335x-pxm2.dtsi              |    2 +-
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-regor-rdk-u-boot.dtsi  |    2 +
 arch/arm/dts/am335x-rut-u-boot.dtsi        |   16 +-
 arch/arm/dts/am335x-rut.dts                |    2 +-
 arch/arm/dts/am335x-shc-u-boot.dtsi        |    2 +
 arch/arm/dts/am335x-shc.dts                |    2 +-
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi   |    2 +
 arch/arm/dts/am33xx-clocks.dtsi            |  106 +-
 arch/arm/dts/am33xx-l4.dtsi                | 1962 ++++++++++++++++++++
 arch/arm/dts/am33xx-u-boot.dtsi            |    8 +
 arch/arm/dts/am33xx.dtsi                   |  721 +++----
 arch/arm/dts/da850-evm-u-boot.dtsi         |   18 +-
 arch/arm/include/asm/arch-am33xx/clock.h   |    1 +
 arch/arm/mach-omap2/am33xx/clock.c         |   10 +-
 arch/arm/mach-omap2/am33xx/clock_am33xx.c  |    2 +-
 arch/sandbox/dts/test.dts                  |   67 +
 arch/sandbox/include/asm/clk.h             |    9 +
 board/ti/am335x/board.c                    |    2 +-
 board/ti/am43xx/board.c                    |    2 +-
 common/fdt_support.c                       |    6 +-
 drivers/bus/Kconfig                        |   13 +
 drivers/bus/Makefile                       |    2 +
 drivers/bus/ti-pwmss.c                     |   21 +
 drivers/bus/ti-sysc.c                      |  166 ++
 drivers/clk/Kconfig                        |    9 +-
 drivers/clk/Makefile                       |    2 +-
 drivers/clk/clk-divider.c                  |   24 +-
 drivers/clk/clk-uclass.c                   |   15 +
 drivers/clk/clk_sandbox.c                  |   17 +
 drivers/clk/clk_sandbox_test.c             |   10 +
 drivers/clk/ti/Kconfig                     |   43 +
 drivers/clk/ti/Makefile                    |   13 +
 drivers/clk/ti/clk-am3-dpll-x2.c           |   79 +
 drivers/clk/ti/clk-am3-dpll.c              |  268 +++
 drivers/clk/ti/clk-ctrl.c                  |  154 ++
 drivers/clk/ti/clk-divider.c               |  381 ++++
 drivers/clk/ti/clk-gate.c                  |   93 +
 drivers/clk/ti/clk-mux.c                   |  253 +++
 drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} |    0
 drivers/clk/ti/clk.c                       |   34 +
 drivers/clk/ti/clk.h                       |   13 +
 drivers/clk/ti/omap4-cm.c                  |   22 +
 drivers/core/Kconfig                       |   12 +
 drivers/core/fdtaddr.c                     |    2 +-
 drivers/core/of_addr.c                     |   14 +-
 drivers/core/ofnode.c                      |    7 +-
 drivers/core/read.c                        |    6 +
 drivers/core/root.c                        |    3 +
 drivers/pwm/Kconfig                        |    7 +
 drivers/pwm/Makefile                       |    1 +
 drivers/pwm/pwm-ti-ehrpwm.c                |  468 +++++
 drivers/timer/omap-timer.c                 |    6 +-
 drivers/video/Kconfig                      |    5 +-
 drivers/video/Makefile                     |    2 +-
 drivers/video/ti/Kconfig                   |    8 +
 drivers/video/ti/Makefile                  |   10 +
 drivers/video/{ => ti}/am335x-fb.c         |  342 +---
 drivers/video/{ => ti}/am335x-fb.h         |    4 -
 drivers/video/ti/tilcdc-panel.c            |  172 ++
 drivers/video/ti/tilcdc-panel.h            |   14 +
 drivers/video/ti/tilcdc.c                  |  425 +++++
 drivers/video/ti/tilcdc.h                  |   38 +
 include/asm-generic/global_data.h          |   18 +
 include/clk-uclass.h                       |    8 +
 include/clk.h                              |   28 +
 include/dm/read.h                          |   24 +
 include/dt-bindings/bus/ti-sysc.h          |    6 +
 include/linux/clk-provider.h               |   57 +
 test/dm/clk.c                              |   22 +
 test/dm/test-fdt.c                         |  149 +-
 86 files changed, 5670 insertions(+), 969 deletions(-)
 create mode 100644 arch/arm/dts/am33xx-l4.dtsi
 create mode 100644 drivers/bus/ti-pwmss.c
 create mode 100644 drivers/bus/ti-sysc.c
 create mode 100644 drivers/clk/ti/Kconfig
 create mode 100644 drivers/clk/ti/Makefile
 create mode 100644 drivers/clk/ti/clk-am3-dpll-x2.c
 create mode 100644 drivers/clk/ti/clk-am3-dpll.c
 create mode 100644 drivers/clk/ti/clk-ctrl.c
 create mode 100644 drivers/clk/ti/clk-divider.c
 create mode 100644 drivers/clk/ti/clk-gate.c
 create mode 100644 drivers/clk/ti/clk-mux.c
 rename drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} (100%)
 create mode 100644 drivers/clk/ti/clk.c
 create mode 100644 drivers/clk/ti/clk.h
 create mode 100644 drivers/clk/ti/omap4-cm.c
 create mode 100644 drivers/pwm/pwm-ti-ehrpwm.c
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 rename drivers/video/{ => ti}/am335x-fb.c (54%)
 rename drivers/video/{ => ti}/am335x-fb.h (97%)
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
#22 lore raw

v6 cover Add DM support for omap PWM backlight

Hi Lokesh,

Quoted 33 lines

Il 22/12/2020 14:52 Lokesh Vutla <[email protected]> ha scritto:

Hi Dario,

Quoted 27 lines · Dario Binacchi

The series was born from the need to manage the PWM backlight of the display connected to my beaglebone board. To hit the target, I had to develop drivers for PWM management which in turn relied on drivers for managing timers and clocks, all developed according to the driver model. My intention was to use the SoC-specific API only at strictly necessary points in the code. My previous patches for migrating the AM335x display driver to the driver model had required the implementation of additional functions outside the concerns of the driver, (settings for dividing the pixel clock rate, configuring the display DPLL rate, ....) not being able to use the API of the related clock drivers. This series shouldn't have repeated the same kind of mistake. Furthermore, I also wanted to fix that kind of forced choice. Almost everything should have been accessible via the driver model API. In the series there are also some patches that could be submitted separately, but which I have however inserted to avoid applying future patches to incorporate them.
With this last consideration, I hope I have convincingly justified the large number of patches in the series.

The patch enabling address translation into a CPU physical address from device-tree even in case of crossing levels with #size-cells = <0>, is crucial for the series. The previous implementation was unable to perform the address translation required by the am33xx device tree. I tried to apply in a conservative way as few changes as possible and to verify the execution of all the tests already developed, as well as the new ones I added for the new feature.

Quoted 4 lines
Quoted 2 lines

The patch series can be cleanly applied to the HEAD of the master which at the time of release points to 12e396303c commit.

Are we waiting for any other reviews? TI part looks good to me.

Everything is reviewed. There are no pending reviews.

Quoted 2 lines

If everything else is reviewed, Ill merge the series.

Do you need the series to be rebased on master?
I uploaded it just a month ago

Quoted 3 lines

Please CC me for all the series next time else it is difficult for me to track the comments

Ok, I will do it.

Thanks and regards,
Dario

Quoted 263 lines

Thanks and regards,
Lokesh

Quoted 260 lines

Changes in v6:
- Remove the 'am3-prcm' driver.
- Add the 'simple-bus' compatible string to the prcm_clocks node.
- Remove the 'am3-scm' driver.
- Add the 'simple-bus' compatible string to the scm_clocks node.

Changes in v5:
- Create drivers/clk/ti directory.
- Move the clk-ti-mux.c file to drivers/clk/ti and rename it clk-mux.c
- Move the clk-ti-am3-dpll.c file to drivers/clk/ti with the name clk-am3-dpll.c.
- Move the clk-ti-am3-dpll-x2.c file to drivers/clk/ti with the name clk-am3-dpll-x2.c.
- Move the clk-ti.c file to drivers/clk/ti with the name clk.c.
- Move the clk-ti.h file to drivers/clk/ti with the name clk.h.
- Move the clk-ti-divider.c file to drivers/clk/ti with the name clk-divider.c.
- Move the clk-ti-gate.c file to drivers/clk/ti with the name clk-gate.c.
- Move the clk-ti-ctrl.c file to drivers/clk/ti with the name clk-ctrl.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Remove a blank line at end of file arch/arm/dts/am33xx-l4.dtsi.
- Update clk_round_rate description.
- Add Sean Anderson review.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Simon Glass review.
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/clock-bindings.txt.
- Remove doc/device-tree-bindings/clock/ti,mux.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,dpll.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,autoidle.txt.
- Remove doc/device-tree-bindings/clock/ti,divider.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/gpio-gate-clock.txt.
- Remove doc/device-tree-bindings/clock/ti,clockdomain.txt.
- Remove doc/device-tree-bindings/clock/ti,gate.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Fix access to registers listed by device tree following resync of am33xx-clock.dtsi with Linux 5.9-rc7.
- Remove doc/device-tree-bindings/clock/ti,clkctrl.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- doc/device-tree-bindings/arm/omap,prcm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Add to commit message the references to linux kernel dt binding documentation.
- Comment dm_flags field in the global_data structure.
- Remove doc/device-tree-bindings/arm/omap,ctrl.txt.
- Remove doc/device-tree-bindings/pinctrl/pinctrl-single.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Adds PWM_TI_EHRPWM dependency on ARCH_OMAP2PLUS in Kconfig.
- Add error message in case of invalid address.
- Remove doc/device-tree-bindings/pwm/ti,ehrpwm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Move Kconfig symbol from drivers/pwm to drivers/bus.
- Remove the domain clock reference from the pwmss nodes of the device tree in am33xx.dtsi. The resync of am33xx.dtsi with Linux 5.9-rc7 already contains such references.
- Remove domain clock enabling/disabling. Enabling the domain clock is performed by the sysc interconnect target module driver during the pwm device probing.
- Remove doc/device-tree-bindings/pwm/ti,pwmss.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Update the DTS lcdc node of the am335x boards because of the am33xx.dtsi resynced with Linux 5.9-rc7.
- Remove clock domain enabling/disabling.
- Update the commit message.
- Add clk.h header.
- Fix an error code returned by the probe function.

Changes in v2:
- Add the clk_ prefix to the divider functions.
- Add kernel-doc comments to the exported functions.
- Merged to patch [09/31] clk: ti: refactor mux and divider clock drivers.
- Remove the 'ti_am3_prcm_clocks' driver. Handle 'prcm_clocks' node in the 'ti_am3_prcm' driver.
- Update the commit message.
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.
- Remove the 'ti_am3_scm_clocks' driver. Handle 'scm_clocks' node in the 'ti_am3_scm' driver.
- Update the commit message.

Dario Binacchi (28):
clk: export generic routines
dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7
bus: ti: add minimal sysc interconnect target driver
arm: dts: sync am33xx with Linux 5.9-rc7
clk: add clk_round_rate()
clk: ti: add mux clock driver
arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro
clk: ti: am33xx: add DPLL clock drivers
clk: ti: add divider clock driver
clk: ti: add gate clock driver
arm: dts: am335x: include am33xx-u-boot.dtsi
ti: am33xx: fix do_enable_clocks() to accept NULL parameters
clk: ti: add support for clkctrl clocks
clk: ti: omap4: add clock manager driver
arm: dts: am335x: enable prcm_clocks auto binding
clk: move clk-ti-sci driver to 'ti' directory
fdt: translate address if #size-cells = <0>
omap: timer: fix the rate setting
arm: dts: am335x: enable scm_clocks auto binding
pwm: ti: am33xx: add enhanced pwm driver
bus: ti: am33xx: add pwm subsystem driver
dm: core: add a function to decode display timings
video: omap: add panel driver
video: omap: drop domain clock enabling by SOC api
video: omap: set LCD clock rate through DM API
video: omap: split the legacy code from the DM code
video: omap: move drivers to 'ti' directory
board: ti: am335x-ice: get CDCE913 clock device

 arch/arm/Kconfig                           |    1 +
 arch/arm/dts/am335x-brppt1-mmc.dts         |   17 +-
 arch/arm/dts/am335x-brppt1-nand.dts        |   17 +-
 arch/arm/dts/am335x-brppt1-spi.dts         |   17 +-
 arch/arm/dts/am335x-brsmarc1.dts           |   20 +-
 arch/arm/dts/am335x-brxre1.dts             |   21 +-
 arch/arm/dts/am335x-chiliboard-u-boot.dtsi |    2 +
 arch/arm/dts/am335x-draco.dtsi             |   11 +-
 arch/arm/dts/am335x-evm-u-boot.dtsi        |   17 +-
 arch/arm/dts/am335x-evm.dts                |    2 +-
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-evmsk.dts              |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi   |   25 +-
 arch/arm/dts/am335x-icev2-u-boot.dtsi      |    3 +
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     |   20 +-
 arch/arm/dts/am335x-pxm2.dtsi              |    2 +-
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-regor-rdk-u-boot.dtsi  |    2 +
 arch/arm/dts/am335x-rut-u-boot.dtsi        |   16 +-
 arch/arm/dts/am335x-rut.dts                |    2 +-
 arch/arm/dts/am335x-shc-u-boot.dtsi        |    2 +
 arch/arm/dts/am335x-shc.dts                |    2 +-
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi   |    2 +
 arch/arm/dts/am33xx-clocks.dtsi            |  106 +-
 arch/arm/dts/am33xx-l4.dtsi                | 1962 ++++++++++++++++++++
 arch/arm/dts/am33xx-u-boot.dtsi            |    8 +
 arch/arm/dts/am33xx.dtsi                   |  721 +++----
 arch/arm/dts/da850-evm-u-boot.dtsi         |   18 +-
 arch/arm/include/asm/arch-am33xx/clock.h   |    1 +
 arch/arm/mach-omap2/am33xx/clock.c         |   10 +-
 arch/arm/mach-omap2/am33xx/clock_am33xx.c  |    2 +-
 arch/sandbox/dts/test.dts                  |   67 +
 arch/sandbox/include/asm/clk.h             |    9 +
 board/ti/am335x/board.c                    |    2 +-
 board/ti/am43xx/board.c                    |    2 +-
 common/fdt_support.c                       |    6 +-
 drivers/bus/Kconfig                        |   13 +
 drivers/bus/Makefile                       |    2 +
 drivers/bus/ti-pwmss.c                     |   21 +
 drivers/bus/ti-sysc.c                      |  166 ++
 drivers/clk/Kconfig                        |    9 +-
 drivers/clk/Makefile                       |    2 +-
 drivers/clk/clk-divider.c                  |   24 +-
 drivers/clk/clk-uclass.c                   |   15 +
 drivers/clk/clk_sandbox.c                  |   17 +
 drivers/clk/clk_sandbox_test.c             |   10 +
 drivers/clk/ti/Kconfig                     |   43 +
 drivers/clk/ti/Makefile                    |   13 +
 drivers/clk/ti/clk-am3-dpll-x2.c           |   79 +
 drivers/clk/ti/clk-am3-dpll.c              |  268 +++
 drivers/clk/ti/clk-ctrl.c                  |  154 ++
 drivers/clk/ti/clk-divider.c               |  381 ++++
 drivers/clk/ti/clk-gate.c                  |   93 +
 drivers/clk/ti/clk-mux.c                   |  253 +++
 drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} |    0
 drivers/clk/ti/clk.c                       |   34 +
 drivers/clk/ti/clk.h                       |   13 +
 drivers/clk/ti/omap4-cm.c                  |   22 +
 drivers/core/Kconfig                       |   12 +
 drivers/core/fdtaddr.c                     |    2 +-
 drivers/core/of_addr.c                     |   14 +-
 drivers/core/ofnode.c                      |    7 +-
 drivers/core/read.c                        |    6 +
 drivers/core/root.c                        |    3 +
 drivers/pwm/Kconfig                        |    7 +
 drivers/pwm/Makefile                       |    1 +
 drivers/pwm/pwm-ti-ehrpwm.c                |  468 +++++
 drivers/timer/omap-timer.c                 |    6 +-
 drivers/video/Kconfig                      |    5 +-
 drivers/video/Makefile                     |    2 +-
 drivers/video/ti/Kconfig                   |    8 +
 drivers/video/ti/Makefile                  |   10 +
 drivers/video/{ => ti}/am335x-fb.c         |  342 +---
 drivers/video/{ => ti}/am335x-fb.h         |    4 -
 drivers/video/ti/tilcdc-panel.c            |  172 ++
 drivers/video/ti/tilcdc-panel.h            |   14 +
 drivers/video/ti/tilcdc.c                  |  425 +++++
 drivers/video/ti/tilcdc.h                  |   38 +
 include/asm-generic/global_data.h          |   18 +
 include/clk-uclass.h                       |    8 +
 include/clk.h                              |   28 +
 include/dm/read.h                          |   24 +
 include/dt-bindings/bus/ti-sysc.h          |    6 +
 include/linux/clk-provider.h               |   57 +
 test/dm/clk.c                              |   22 +
 test/dm/test-fdt.c                         |  149 +-
 86 files changed, 5670 insertions(+), 969 deletions(-)
 create mode 100644 arch/arm/dts/am33xx-l4.dtsi
 create mode 100644 drivers/bus/ti-pwmss.c
 create mode 100644 drivers/bus/ti-sysc.c
 create mode 100644 drivers/clk/ti/Kconfig
 create mode 100644 drivers/clk/ti/Makefile
 create mode 100644 drivers/clk/ti/clk-am3-dpll-x2.c
 create mode 100644 drivers/clk/ti/clk-am3-dpll.c
 create mode 100644 drivers/clk/ti/clk-ctrl.c
 create mode 100644 drivers/clk/ti/clk-divider.c
 create mode 100644 drivers/clk/ti/clk-gate.c
 create mode 100644 drivers/clk/ti/clk-mux.c
 rename drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} (100%)
 create mode 100644 drivers/clk/ti/clk.c
 create mode 100644 drivers/clk/ti/clk.h
 create mode 100644 drivers/clk/ti/omap4-cm.c
 create mode 100644 drivers/pwm/pwm-ti-ehrpwm.c
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 rename drivers/video/{ => ti}/am335x-fb.c (54%)
 rename drivers/video/{ => ti}/am335x-fb.h (97%)
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
#23 lore raw

v6 cover Add DM support for omap PWM backlight

Quoted 40 lines · Dario Binacchi

Hi Lokesh,

Quoted 33 lines

Il 22/12/2020 14:52 Lokesh Vutla <[email protected]> ha scritto:

Hi Dario,

Quoted 27 lines · Dario Binacchi

The series was born from the need to manage the PWM backlight of the display connected to my beaglebone board. To hit the target, I had to develop drivers for PWM management which in turn relied on drivers for managing timers and clocks, all developed according to the driver model. My intention was to use the SoC-specific API only at strictly necessary points in the code. My previous patches for migrating the AM335x display driver to the driver model had required the implementation of additional functions outside the concerns of the driver, (settings for dividing the pixel clock rate, configuring the display DPLL rate, ....) not being able to use the API of the related clock drivers. This series shouldn't have repeated the same kind of mistake. Furthermore, I also wanted to fix that kind of forced choice. Almost everything should have been accessible via the driver model API. In the series there are also some patches that could be submitted separately, but which I have however inserted to avoid applying future patches to incorporate them.
With this last consideration, I hope I have convincingly justified the large number of patches in the series.

The patch enabling address translation into a CPU physical address from device-tree even in case of crossing levels with #size-cells = <0>, is crucial for the series. The previous implementation was unable to perform the address translation required by the am33xx device tree. I tried to apply in a conservative way as few changes as possible and to verify the execution of all the tests already developed, as well as the new ones I added for the new feature.

Quoted 4 lines
Quoted 2 lines

The patch series can be cleanly applied to the HEAD of the master which at the time of release points to 12e396303c commit.

Are we waiting for any other reviews? TI part looks good to me.

Quoted 7 lines

Everything is reviewed. There are no pending reviews.

Quoted 2 lines

If everything else is reviewed, Ill merge the series.

Do you need the series to be rebased on master?
I uploaded it just a month ago

This series is causing build error for powerpc platforms. Can you take a look?
https://gitlab.denx.de/u-boot/custodians/u-boot-ti/-/jobs/193065

Thanks and regards,
Lokesh

Quoted 273 lines
Quoted 4 lines

Please CC me for all the series next time else it is difficult for me to track the comments

Ok, I will do it.

Thanks and regards,
Dario

Quoted 263 lines

Thanks and regards,
Lokesh

Quoted 260 lines

Changes in v6:
- Remove the 'am3-prcm' driver.
- Add the 'simple-bus' compatible string to the prcm_clocks node.
- Remove the 'am3-scm' driver.
- Add the 'simple-bus' compatible string to the scm_clocks node.

Changes in v5:
- Create drivers/clk/ti directory.
- Move the clk-ti-mux.c file to drivers/clk/ti and rename it clk-mux.c
- Move the clk-ti-am3-dpll.c file to drivers/clk/ti with the name clk-am3-dpll.c.
- Move the clk-ti-am3-dpll-x2.c file to drivers/clk/ti with the name clk-am3-dpll-x2.c.
- Move the clk-ti.c file to drivers/clk/ti with the name clk.c.
- Move the clk-ti.h file to drivers/clk/ti with the name clk.h.
- Move the clk-ti-divider.c file to drivers/clk/ti with the name clk-divider.c.
- Move the clk-ti-gate.c file to drivers/clk/ti with the name clk-gate.c.
- Move the clk-ti-ctrl.c file to drivers/clk/ti with the name clk-ctrl.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Remove a blank line at end of file arch/arm/dts/am33xx-l4.dtsi.
- Update clk_round_rate description.
- Add Sean Anderson review.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Simon Glass review.
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/clock-bindings.txt.
- Remove doc/device-tree-bindings/clock/ti,mux.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,dpll.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,autoidle.txt.
- Remove doc/device-tree-bindings/clock/ti,divider.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/gpio-gate-clock.txt.
- Remove doc/device-tree-bindings/clock/ti,clockdomain.txt.
- Remove doc/device-tree-bindings/clock/ti,gate.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Fix access to registers listed by device tree following resync of am33xx-clock.dtsi with Linux 5.9-rc7.
- Remove doc/device-tree-bindings/clock/ti,clkctrl.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- doc/device-tree-bindings/arm/omap,prcm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Add to commit message the references to linux kernel dt binding documentation.
- Comment dm_flags field in the global_data structure.
- Remove doc/device-tree-bindings/arm/omap,ctrl.txt.
- Remove doc/device-tree-bindings/pinctrl/pinctrl-single.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Adds PWM_TI_EHRPWM dependency on ARCH_OMAP2PLUS in Kconfig.
- Add error message in case of invalid address.
- Remove doc/device-tree-bindings/pwm/ti,ehrpwm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Move Kconfig symbol from drivers/pwm to drivers/bus.
- Remove the domain clock reference from the pwmss nodes of the device tree in am33xx.dtsi. The resync of am33xx.dtsi with Linux 5.9-rc7 already contains such references.
- Remove domain clock enabling/disabling. Enabling the domain clock is performed by the sysc interconnect target module driver during the pwm device probing.
- Remove doc/device-tree-bindings/pwm/ti,pwmss.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Update the DTS lcdc node of the am335x boards because of the am33xx.dtsi resynced with Linux 5.9-rc7.
- Remove clock domain enabling/disabling.
- Update the commit message.
- Add clk.h header.
- Fix an error code returned by the probe function.

Changes in v2:
- Add the clk_ prefix to the divider functions.
- Add kernel-doc comments to the exported functions.
- Merged to patch [09/31] clk: ti: refactor mux and divider clock drivers.
- Remove the 'ti_am3_prcm_clocks' driver. Handle 'prcm_clocks' node in the 'ti_am3_prcm' driver.
- Update the commit message.
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.
- Remove the 'ti_am3_scm_clocks' driver. Handle 'scm_clocks' node in the 'ti_am3_scm' driver.
- Update the commit message.

Dario Binacchi (28):
clk: export generic routines
dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7
bus: ti: add minimal sysc interconnect target driver
arm: dts: sync am33xx with Linux 5.9-rc7
clk: add clk_round_rate()
clk: ti: add mux clock driver
arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro
clk: ti: am33xx: add DPLL clock drivers
clk: ti: add divider clock driver
clk: ti: add gate clock driver
arm: dts: am335x: include am33xx-u-boot.dtsi
ti: am33xx: fix do_enable_clocks() to accept NULL parameters
clk: ti: add support for clkctrl clocks
clk: ti: omap4: add clock manager driver
arm: dts: am335x: enable prcm_clocks auto binding
clk: move clk-ti-sci driver to 'ti' directory
fdt: translate address if #size-cells = <0>
omap: timer: fix the rate setting
arm: dts: am335x: enable scm_clocks auto binding
pwm: ti: am33xx: add enhanced pwm driver
bus: ti: am33xx: add pwm subsystem driver
dm: core: add a function to decode display timings
video: omap: add panel driver
video: omap: drop domain clock enabling by SOC api
video: omap: set LCD clock rate through DM API
video: omap: split the legacy code from the DM code
video: omap: move drivers to 'ti' directory
board: ti: am335x-ice: get CDCE913 clock device

 arch/arm/Kconfig                           |    1 +
 arch/arm/dts/am335x-brppt1-mmc.dts         |   17 +-
 arch/arm/dts/am335x-brppt1-nand.dts        |   17 +-
 arch/arm/dts/am335x-brppt1-spi.dts         |   17 +-
 arch/arm/dts/am335x-brsmarc1.dts           |   20 +-
 arch/arm/dts/am335x-brxre1.dts             |   21 +-
 arch/arm/dts/am335x-chiliboard-u-boot.dtsi |    2 +
 arch/arm/dts/am335x-draco.dtsi             |   11 +-
 arch/arm/dts/am335x-evm-u-boot.dtsi        |   17 +-
 arch/arm/dts/am335x-evm.dts                |    2 +-
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-evmsk.dts              |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi   |   25 +-
 arch/arm/dts/am335x-icev2-u-boot.dtsi      |    3 +
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     |   20 +-
 arch/arm/dts/am335x-pxm2.dtsi              |    2 +-
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-regor-rdk-u-boot.dtsi  |    2 +
 arch/arm/dts/am335x-rut-u-boot.dtsi        |   16 +-
 arch/arm/dts/am335x-rut.dts                |    2 +-
 arch/arm/dts/am335x-shc-u-boot.dtsi        |    2 +
 arch/arm/dts/am335x-shc.dts                |    2 +-
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi   |    2 +
 arch/arm/dts/am33xx-clocks.dtsi            |  106 +-
 arch/arm/dts/am33xx-l4.dtsi                | 1962 ++++++++++++++++++++
 arch/arm/dts/am33xx-u-boot.dtsi            |    8 +
 arch/arm/dts/am33xx.dtsi                   |  721 +++----
 arch/arm/dts/da850-evm-u-boot.dtsi         |   18 +-
 arch/arm/include/asm/arch-am33xx/clock.h   |    1 +
 arch/arm/mach-omap2/am33xx/clock.c         |   10 +-
 arch/arm/mach-omap2/am33xx/clock_am33xx.c  |    2 +-
 arch/sandbox/dts/test.dts                  |   67 +
 arch/sandbox/include/asm/clk.h             |    9 +
 board/ti/am335x/board.c                    |    2 +-
 board/ti/am43xx/board.c                    |    2 +-
 common/fdt_support.c                       |    6 +-
 drivers/bus/Kconfig                        |   13 +
 drivers/bus/Makefile                       |    2 +
 drivers/bus/ti-pwmss.c                     |   21 +
 drivers/bus/ti-sysc.c                      |  166 ++
 drivers/clk/Kconfig                        |    9 +-
 drivers/clk/Makefile                       |    2 +-
 drivers/clk/clk-divider.c                  |   24 +-
 drivers/clk/clk-uclass.c                   |   15 +
 drivers/clk/clk_sandbox.c                  |   17 +
 drivers/clk/clk_sandbox_test.c             |   10 +
 drivers/clk/ti/Kconfig                     |   43 +
 drivers/clk/ti/Makefile                    |   13 +
 drivers/clk/ti/clk-am3-dpll-x2.c           |   79 +
 drivers/clk/ti/clk-am3-dpll.c              |  268 +++
 drivers/clk/ti/clk-ctrl.c                  |  154 ++
 drivers/clk/ti/clk-divider.c               |  381 ++++
 drivers/clk/ti/clk-gate.c                  |   93 +
 drivers/clk/ti/clk-mux.c                   |  253 +++
 drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} |    0
 drivers/clk/ti/clk.c                       |   34 +
 drivers/clk/ti/clk.h                       |   13 +
 drivers/clk/ti/omap4-cm.c                  |   22 +
 drivers/core/Kconfig                       |   12 +
 drivers/core/fdtaddr.c                     |    2 +-
 drivers/core/of_addr.c                     |   14 +-
 drivers/core/ofnode.c                      |    7 +-
 drivers/core/read.c                        |    6 +
 drivers/core/root.c                        |    3 +
 drivers/pwm/Kconfig                        |    7 +
 drivers/pwm/Makefile                       |    1 +
 drivers/pwm/pwm-ti-ehrpwm.c                |  468 +++++
 drivers/timer/omap-timer.c                 |    6 +-
 drivers/video/Kconfig                      |    5 +-
 drivers/video/Makefile                     |    2 +-
 drivers/video/ti/Kconfig                   |    8 +
 drivers/video/ti/Makefile                  |   10 +
 drivers/video/{ => ti}/am335x-fb.c         |  342 +---
 drivers/video/{ => ti}/am335x-fb.h         |    4 -
 drivers/video/ti/tilcdc-panel.c            |  172 ++
 drivers/video/ti/tilcdc-panel.h            |   14 +
 drivers/video/ti/tilcdc.c                  |  425 +++++
 drivers/video/ti/tilcdc.h                  |   38 +
 include/asm-generic/global_data.h          |   18 +
 include/clk-uclass.h                       |    8 +
 include/clk.h                              |   28 +
 include/dm/read.h                          |   24 +
 include/dt-bindings/bus/ti-sysc.h          |    6 +
 include/linux/clk-provider.h               |   57 +
 test/dm/clk.c                              |   22 +
 test/dm/test-fdt.c                         |  149 +-
 86 files changed, 5670 insertions(+), 969 deletions(-)
 create mode 100644 arch/arm/dts/am33xx-l4.dtsi
 create mode 100644 drivers/bus/ti-pwmss.c
 create mode 100644 drivers/bus/ti-sysc.c
 create mode 100644 drivers/clk/ti/Kconfig
 create mode 100644 drivers/clk/ti/Makefile
 create mode 100644 drivers/clk/ti/clk-am3-dpll-x2.c
 create mode 100644 drivers/clk/ti/clk-am3-dpll.c
 create mode 100644 drivers/clk/ti/clk-ctrl.c
 create mode 100644 drivers/clk/ti/clk-divider.c
 create mode 100644 drivers/clk/ti/clk-gate.c
 create mode 100644 drivers/clk/ti/clk-mux.c
 rename drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} (100%)
 create mode 100644 drivers/clk/ti/clk.c
 create mode 100644 drivers/clk/ti/clk.h
 create mode 100644 drivers/clk/ti/omap4-cm.c
 create mode 100644 drivers/pwm/pwm-ti-ehrpwm.c
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 rename drivers/video/{ => ti}/am335x-fb.c (54%)
 rename drivers/video/{ => ti}/am335x-fb.h (97%)
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h
#24 lore raw

v6 cover Add DM support for omap PWM backlight

Hi Lokesh,

Quoted 46 lines

Il 23/12/2020 08:57 Lokesh Vutla <[email protected]> ha scritto:

Quoted 42 lines · Dario Binacchi

Hi Lokesh,

Quoted 33 lines

Il 22/12/2020 14:52 Lokesh Vutla <[email protected]> ha scritto:

Hi Dario,

Quoted 27 lines · Dario Binacchi

The series was born from the need to manage the PWM backlight of the display connected to my beaglebone board. To hit the target, I had to develop drivers for PWM management which in turn relied on drivers for managing timers and clocks, all developed according to the driver model. My intention was to use the SoC-specific API only at strictly necessary points in the code. My previous patches for migrating the AM335x display driver to the driver model had required the implementation of additional functions outside the concerns of the driver, (settings for dividing the pixel clock rate, configuring the display DPLL rate, ....) not being able to use the API of the related clock drivers. This series shouldn't have repeated the same kind of mistake. Furthermore, I also wanted to fix that kind of forced choice. Almost everything should have been accessible via the driver model API. In the series there are also some patches that could be submitted separately, but which I have however inserted to avoid applying future patches to incorporate them.
With this last consideration, I hope I have convincingly justified the large number of patches in the series.

The patch enabling address translation into a CPU physical address from device-tree even in case of crossing levels with #size-cells = <0>, is crucial for the series. The previous implementation was unable to perform the address translation required by the am33xx device tree. I tried to apply in a conservative way as few changes as possible and to verify the execution of all the tests already developed, as well as the new ones I added for the new feature.

Quoted 4 lines
Quoted 2 lines

The patch series can be cleanly applied to the HEAD of the master which at the time of release points to 12e396303c commit.

Are we waiting for any other reviews? TI part looks good to me.

Everything is reviewed. There are no pending reviews.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

If everything else is reviewed, Ill merge the series.

Do you need the series to be rebased on master?
I uploaded it just a month ago

This series is causing build error for powerpc platforms. Can you take a look?
https://gitlab.denx.de/u-boot/custodians/u-boot-ti/-/jobs/193065

I think CONFIG_DM is not enabled, so dm_flags is not added in 'struct global_data' by the C preprocessor.
Moving dm_flags out of '#ifdef CONFIG_DM' in 'struct global_data', would fix the error but I don't think that's the right way. I think it is more correct to consider dm_flags only when CONFIG_DM is enabled.

Thanks and regards,
Dario

Quoted 276 lines

Thanks and regards,
Lokesh

Quoted 273 lines
Quoted 4 lines

Please CC me for all the series next time else it is difficult for me to track the comments

Ok, I will do it.

Thanks and regards,
Dario

Quoted 263 lines

Thanks and regards,
Lokesh

Quoted 260 lines

Changes in v6:
- Remove the 'am3-prcm' driver.
- Add the 'simple-bus' compatible string to the prcm_clocks node.
- Remove the 'am3-scm' driver.
- Add the 'simple-bus' compatible string to the scm_clocks node.

Changes in v5:
- Create drivers/clk/ti directory.
- Move the clk-ti-mux.c file to drivers/clk/ti and rename it clk-mux.c
- Move the clk-ti-am3-dpll.c file to drivers/clk/ti with the name clk-am3-dpll.c.
- Move the clk-ti-am3-dpll-x2.c file to drivers/clk/ti with the name clk-am3-dpll-x2.c.
- Move the clk-ti.c file to drivers/clk/ti with the name clk.c.
- Move the clk-ti.h file to drivers/clk/ti with the name clk.h.
- Move the clk-ti-divider.c file to drivers/clk/ti with the name clk-divider.c.
- Move the clk-ti-gate.c file to drivers/clk/ti with the name clk-gate.c.
- Move the clk-ti-ctrl.c file to drivers/clk/ti with the name clk-ctrl.c.

Changes in v4:
- Include device_compat.h header for dev_xxx macros.
- Remove a blank line at end of file arch/arm/dts/am33xx-l4.dtsi.
- Update clk_round_rate description.
- Add Sean Anderson review.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Fix compilation errors on the dev parameter of the dev_xx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Sphinx documentation for dm_flags.
- Convert GD_DM_FLG_* to enum.
- Include device_compat.h header in test/dm/test-fdt.c for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Include device_compat.h header for dev_xxx macros.
- Add Simon Glass review.
- Include device_compat.h header for dev_xxx macros.

Changes in v3:
- Remove doc/device-tree-bindings/clock/clock-bindings.txt.
- Remove doc/device-tree-bindings/clock/ti,mux.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,dpll.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/ti,autoidle.txt.
- Remove doc/device-tree-bindings/clock/ti,divider.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Remove doc/device-tree-bindings/clock/gpio-gate-clock.txt.
- Remove doc/device-tree-bindings/clock/ti,clockdomain.txt.
- Remove doc/device-tree-bindings/clock/ti,gate.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Fix access to registers listed by device tree following resync of am33xx-clock.dtsi with Linux 5.9-rc7.
- Remove doc/device-tree-bindings/clock/ti,clkctrl.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- doc/device-tree-bindings/arm/omap,prcm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Add to commit message the references to linux kernel dt binding documentation.
- Comment dm_flags field in the global_data structure.
- Remove doc/device-tree-bindings/arm/omap,ctrl.txt.
- Remove doc/device-tree-bindings/pinctrl/pinctrl-single.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Adds PWM_TI_EHRPWM dependency on ARCH_OMAP2PLUS in Kconfig.
- Add error message in case of invalid address.
- Remove doc/device-tree-bindings/pwm/ti,ehrpwm.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Move Kconfig symbol from drivers/pwm to drivers/bus.
- Remove the domain clock reference from the pwmss nodes of the device tree in am33xx.dtsi. The resync of am33xx.dtsi with Linux 5.9-rc7 already contains such references.
- Remove domain clock enabling/disabling. Enabling the domain clock is performed by the sysc interconnect target module driver during the pwm device probing.
- Remove doc/device-tree-bindings/pwm/ti,pwmss.txt.
- Add to commit message the references to linux kernel dt binding documentation.
- Update the DTS lcdc node of the am335x boards because of the am33xx.dtsi resynced with Linux 5.9-rc7.
- Remove clock domain enabling/disabling.
- Update the commit message.
- Add clk.h header.
- Fix an error code returned by the probe function.

Changes in v2:
- Add the clk_ prefix to the divider functions.
- Add kernel-doc comments to the exported functions.
- Merged to patch [09/31] clk: ti: refactor mux and divider clock drivers.
- Remove the 'ti_am3_prcm_clocks' driver. Handle 'prcm_clocks' node in the 'ti_am3_prcm' driver.
- Update the commit message.
- Fix a missing line in the commit message.
- Add dm_flags to global_data structure and GD_DM_FLG_SIZE_CELLS_0 macro to test without recompiling.
- Update the OF_CHECK_COUNTS macro in order to have just one #define by bringing the GD_DM_FLG_SIZE_CELLS_0 into the expression.
- Lower-case the 0xC019 hex number.
- Remove the 'ti_am3_scm_clocks' driver. Handle 'scm_clocks' node in the 'ti_am3_scm' driver.
- Update the commit message.

Dario Binacchi (28):
clk: export generic routines
dt-bindings: bus: ti-sysc: resync with Linux 5.9-rc7
bus: ti: add minimal sysc interconnect target driver
arm: dts: sync am33xx with Linux 5.9-rc7
clk: add clk_round_rate()
clk: ti: add mux clock driver
arm: ti: am33xx: add DPLL_EN_FAST_RELOCK_BYPASS macro
clk: ti: am33xx: add DPLL clock drivers
clk: ti: add divider clock driver
clk: ti: add gate clock driver
arm: dts: am335x: include am33xx-u-boot.dtsi
ti: am33xx: fix do_enable_clocks() to accept NULL parameters
clk: ti: add support for clkctrl clocks
clk: ti: omap4: add clock manager driver
arm: dts: am335x: enable prcm_clocks auto binding
clk: move clk-ti-sci driver to 'ti' directory
fdt: translate address if #size-cells = <0>
omap: timer: fix the rate setting
arm: dts: am335x: enable scm_clocks auto binding
pwm: ti: am33xx: add enhanced pwm driver
bus: ti: am33xx: add pwm subsystem driver
dm: core: add a function to decode display timings
video: omap: add panel driver
video: omap: drop domain clock enabling by SOC api
video: omap: set LCD clock rate through DM API
video: omap: split the legacy code from the DM code
video: omap: move drivers to 'ti' directory
board: ti: am335x-ice: get CDCE913 clock device

 arch/arm/Kconfig                           |    1 +
 arch/arm/dts/am335x-brppt1-mmc.dts         |   17 +-
 arch/arm/dts/am335x-brppt1-nand.dts        |   17 +-
 arch/arm/dts/am335x-brppt1-spi.dts         |   17 +-
 arch/arm/dts/am335x-brsmarc1.dts           |   20 +-
 arch/arm/dts/am335x-brxre1.dts             |   21 +-
 arch/arm/dts/am335x-chiliboard-u-boot.dtsi |    2 +
 arch/arm/dts/am335x-draco.dtsi             |   11 +-
 arch/arm/dts/am335x-evm-u-boot.dtsi        |   17 +-
 arch/arm/dts/am335x-evm.dts                |    2 +-
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-evmsk.dts              |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi   |   25 +-
 arch/arm/dts/am335x-icev2-u-boot.dtsi      |    3 +
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     |   20 +-
 arch/arm/dts/am335x-pxm2.dtsi              |    2 +-
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      |   16 +-
 arch/arm/dts/am335x-regor-rdk-u-boot.dtsi  |    2 +
 arch/arm/dts/am335x-rut-u-boot.dtsi        |   16 +-
 arch/arm/dts/am335x-rut.dts                |    2 +-
 arch/arm/dts/am335x-shc-u-boot.dtsi        |    2 +
 arch/arm/dts/am335x-shc.dts                |    2 +-
 arch/arm/dts/am335x-wega-rdk-u-boot.dtsi   |    2 +
 arch/arm/dts/am33xx-clocks.dtsi            |  106 +-
 arch/arm/dts/am33xx-l4.dtsi                | 1962 ++++++++++++++++++++
 arch/arm/dts/am33xx-u-boot.dtsi            |    8 +
 arch/arm/dts/am33xx.dtsi                   |  721 +++----
 arch/arm/dts/da850-evm-u-boot.dtsi         |   18 +-
 arch/arm/include/asm/arch-am33xx/clock.h   |    1 +
 arch/arm/mach-omap2/am33xx/clock.c         |   10 +-
 arch/arm/mach-omap2/am33xx/clock_am33xx.c  |    2 +-
 arch/sandbox/dts/test.dts                  |   67 +
 arch/sandbox/include/asm/clk.h             |    9 +
 board/ti/am335x/board.c                    |    2 +-
 board/ti/am43xx/board.c                    |    2 +-
 common/fdt_support.c                       |    6 +-
 drivers/bus/Kconfig                        |   13 +
 drivers/bus/Makefile                       |    2 +
 drivers/bus/ti-pwmss.c                     |   21 +
 drivers/bus/ti-sysc.c                      |  166 ++
 drivers/clk/Kconfig                        |    9 +-
 drivers/clk/Makefile                       |    2 +-
 drivers/clk/clk-divider.c                  |   24 +-
 drivers/clk/clk-uclass.c                   |   15 +
 drivers/clk/clk_sandbox.c                  |   17 +
 drivers/clk/clk_sandbox_test.c             |   10 +
 drivers/clk/ti/Kconfig                     |   43 +
 drivers/clk/ti/Makefile                    |   13 +
 drivers/clk/ti/clk-am3-dpll-x2.c           |   79 +
 drivers/clk/ti/clk-am3-dpll.c              |  268 +++
 drivers/clk/ti/clk-ctrl.c                  |  154 ++
 drivers/clk/ti/clk-divider.c               |  381 ++++
 drivers/clk/ti/clk-gate.c                  |   93 +
 drivers/clk/ti/clk-mux.c                   |  253 +++
 drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} |    0
 drivers/clk/ti/clk.c                       |   34 +
 drivers/clk/ti/clk.h                       |   13 +
 drivers/clk/ti/omap4-cm.c                  |   22 +
 drivers/core/Kconfig                       |   12 +
 drivers/core/fdtaddr.c                     |    2 +-
 drivers/core/of_addr.c                     |   14 +-
 drivers/core/ofnode.c                      |    7 +-
 drivers/core/read.c                        |    6 +
 drivers/core/root.c                        |    3 +
 drivers/pwm/Kconfig                        |    7 +
 drivers/pwm/Makefile                       |    1 +
 drivers/pwm/pwm-ti-ehrpwm.c                |  468 +++++
 drivers/timer/omap-timer.c                 |    6 +-
 drivers/video/Kconfig                      |    5 +-
 drivers/video/Makefile                     |    2 +-
 drivers/video/ti/Kconfig                   |    8 +
 drivers/video/ti/Makefile                  |   10 +
 drivers/video/{ => ti}/am335x-fb.c         |  342 +---
 drivers/video/{ => ti}/am335x-fb.h         |    4 -
 drivers/video/ti/tilcdc-panel.c            |  172 ++
 drivers/video/ti/tilcdc-panel.h            |   14 +
 drivers/video/ti/tilcdc.c                  |  425 +++++
 drivers/video/ti/tilcdc.h                  |   38 +
 include/asm-generic/global_data.h          |   18 +
 include/clk-uclass.h                       |    8 +
 include/clk.h                              |   28 +
 include/dm/read.h                          |   24 +
 include/dt-bindings/bus/ti-sysc.h          |    6 +
 include/linux/clk-provider.h               |   57 +
 test/dm/clk.c                              |   22 +
 test/dm/test-fdt.c                         |  149 +-
 86 files changed, 5670 insertions(+), 969 deletions(-)
 create mode 100644 arch/arm/dts/am33xx-l4.dtsi
 create mode 100644 drivers/bus/ti-pwmss.c
 create mode 100644 drivers/bus/ti-sysc.c
 create mode 100644 drivers/clk/ti/Kconfig
 create mode 100644 drivers/clk/ti/Makefile
 create mode 100644 drivers/clk/ti/clk-am3-dpll-x2.c
 create mode 100644 drivers/clk/ti/clk-am3-dpll.c
 create mode 100644 drivers/clk/ti/clk-ctrl.c
 create mode 100644 drivers/clk/ti/clk-divider.c
 create mode 100644 drivers/clk/ti/clk-gate.c
 create mode 100644 drivers/clk/ti/clk-mux.c
 rename drivers/clk/{clk-ti-sci.c => ti/clk-sci.c} (100%)
 create mode 100644 drivers/clk/ti/clk.c
 create mode 100644 drivers/clk/ti/clk.h
 create mode 100644 drivers/clk/ti/omap4-cm.c
 create mode 100644 drivers/pwm/pwm-ti-ehrpwm.c
 create mode 100644 drivers/video/ti/Kconfig
 create mode 100644 drivers/video/ti/Makefile
 rename drivers/video/{ => ti}/am335x-fb.c (54%)
 rename drivers/video/{ => ti}/am335x-fb.h (97%)
 create mode 100644 drivers/video/ti/tilcdc-panel.c
 create mode 100644 drivers/video/ti/tilcdc-panel.h
 create mode 100644 drivers/video/ti/tilcdc.c
 create mode 100644 drivers/video/ti/tilcdc.h