mbox series

[v3,00/27] Add DM support for omap PWM backlight

Message ID 20201011121340.21660-1-dariobin@libero.it
Headers show
Series Add DM support for omap PWM backlight | expand

Message

Dario Binacchi Oct. 11, 2020, 12:13 p.m. UTC
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.

As recommended by Grygorii Strashko I have removed some patches to
upload them in new different series:
- [v2,01/30] clk: remove a redundant header
- [v2,03/30] arch: sandbox: fix typo in clk.h
- [v2,20/30] video: backlight: fix pwm's duty cycle calculation
- [v2,21/30] video: backlight: fix pwm data structure description
- [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
- [v2,23/30] gpio: fix gpio_request_by_name() description

Grygorii suggested to remove also other patches that I have kept in the
series to allow anyone who wants to be able to test it. Moreover after
the addition of a patch that has largely changed the device tree. The
patches removed are the one and only ones that do not affect the series
in any way. I hope that the next version of this series will require
only minimal changes allowing me to split it according to Grygorii's
suggestions.

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 (27):
  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
  ti: am33xx: fix do_enable_clocks() to accept NULL parameters
  clk: ti: add support for clkctrl clocks
  clk: ti: move drivers to 'ti' directory
  clk: ti: omap4: add clock manager driver
  clk: ti: am335x: add clock manager driver
  fdt: translate address if #size-cells = <0>
  omap: timer: fix the rate setting
  misc: am33xx: add control module driver
  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-draco.dtsi             |   11 +-
 arch/arm/dts/am335x-evm-u-boot.dtsi        |   15 +-
 arch/arm/dts/am335x-evm.dts                |    2 +-
 arch/arm/dts/am335x-evmsk-u-boot.dtsi      |   14 +-
 arch/arm/dts/am335x-evmsk.dts              |    2 +-
 arch/arm/dts/am335x-guardian-u-boot.dtsi   |   23 +-
 arch/arm/dts/am335x-pdu001-u-boot.dtsi     |   18 +-
 arch/arm/dts/am335x-pxm2.dtsi              |    2 +-
 arch/arm/dts/am335x-pxm50-u-boot.dtsi      |   14 +-
 arch/arm/dts/am335x-rut-u-boot.dtsi        |   14 +-
 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                | 1963 ++++++++++++++++++++
 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                      |  165 ++
 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                     |   42 +
 drivers/clk/ti/Makefile                    |   18 +
 drivers/clk/ti/am3-prcm.c                  |   65 +
 drivers/clk/ti/clk-am3-dpll-x2.c           |   78 +
 drivers/clk/ti/clk-am3-dpll.c              |  267 +++
 drivers/clk/ti/clk-ctrl.c                  |  153 ++
 drivers/clk/ti/clk-divider.c               |  380 ++++
 drivers/clk/ti/clk-gate.c                  |   92 +
 drivers/clk/ti/clk-mux.c                   |  252 +++
 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/misc/Kconfig                       |    7 +
 drivers/misc/Makefile                      |    1 +
 drivers/misc/ti-am3-scm.c                  |   81 +
 drivers/pwm/Kconfig                        |    7 +
 drivers/pwm/Makefile                       |    1 +
 drivers/pwm/pwm-ti-ehrpwm.c                |  467 +++++
 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            |  171 ++
 drivers/video/ti/tilcdc-panel.h            |   14 +
 drivers/video/ti/tilcdc.c                  |  424 +++++
 drivers/video/ti/tilcdc.h                  |   38 +
 include/asm-generic/global_data.h          |    6 +
 include/clk-uclass.h                       |    8 +
 include/clk.h                              |   29 +
 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                         |  148 +-
 84 files changed, 5776 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/am3-prcm.c
 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/misc/ti-am3-scm.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

Comments

Felix Brack Oct. 14, 2020, 8:22 a.m. UTC | #1
On 11.10.20 14:13, Dario Binacchi wrote:
> 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.
> 
> As recommended by Grygorii Strashko I have removed some patches to
> upload them in new different series:
> - [v2,01/30] clk: remove a redundant header
> - [v2,03/30] arch: sandbox: fix typo in clk.h
> - [v2,20/30] video: backlight: fix pwm's duty cycle calculation
> - [v2,21/30] video: backlight: fix pwm data structure description
> - [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
> - [v2,23/30] gpio: fix gpio_request_by_name() description
> 
> Grygorii suggested to remove also other patches that I have kept in the
> series to allow anyone who wants to be able to test it. Moreover after
> the addition of a patch that has largely changed the device tree. The
> patches removed are the one and only ones that do not affect the series
> in any way. I hope that the next version of this series will require
> only minimal changes allowing me to split it according to Grygorii's
> suggestions.
> ---- 

I must be missing something as this patch series does not apply without
errors to U-Boot master:

error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
error: drivers/clk/clk-ti-ctrl.c: No such file or directory
error: drivers/clk/clk-ti-divider.c: No such file or directory
error: drivers/clk/clk-ti-gate.c: No such file or directory
error: drivers/clk/clk-ti-mux.c: No such file or directory
error: drivers/clk/clk-ti.c: No such file or directory
error: drivers/clk/clk-ti.h: No such file or directory
error: drivers/video/tilcdc-panel.c: No such file or directory
error: drivers/video/tilcdc-panel.h: No such file or directory
error: drivers/video/tilcdc.c: No such file or directory
error: drivers/video/tilcdc.h: No such file or directory

Does it probably depend on some other patches?

regards, Felix
Dario Binacchi Oct. 14, 2020, 9:22 p.m. UTC | #2
> Il 14/10/2020 10:22 Felix Brack <fb@ltec.ch> ha scritto:
> 
>  
> On 11.10.20 14:13, Dario Binacchi wrote:
> > 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.
> > 
> > As recommended by Grygorii Strashko I have removed some patches to
> > upload them in new different series:
> > - [v2,01/30] clk: remove a redundant header
> > - [v2,03/30] arch: sandbox: fix typo in clk.h
> > - [v2,20/30] video: backlight: fix pwm's duty cycle calculation
> > - [v2,21/30] video: backlight: fix pwm data structure description
> > - [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
> > - [v2,23/30] gpio: fix gpio_request_by_name() description
> > 
> > Grygorii suggested to remove also other patches that I have kept in the
> > series to allow anyone who wants to be able to test it. Moreover after
> > the addition of a patch that has largely changed the device tree. The
> > patches removed are the one and only ones that do not affect the series
> > in any way. I hope that the next version of this series will require
> > only minimal changes allowing me to split it according to Grygorii's
> > suggestions.
> > ---- 
> 

> I must be missing something as this patch series does not apply without
> errors to U-Boot master:
> 

Hi Felix,
I applied the patch of the series downloaded from patchwork on master and I compiled it without errors.

> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
> error: drivers/clk/clk-ti-divider.c: No such file or directory
> error: drivers/clk/clk-ti-gate.c: No such file or directory
> error: drivers/clk/clk-ti-mux.c: No such file or directory
> error: drivers/clk/clk-ti.c: No such file or directory
> error: drivers/clk/clk-ti.h: No such file or directory

After applying the patch you should find:
ls drivers/clk/ti
am3-prcm.c
clk-am3-dpll.c
clk-am3-dpll-x2.c
clk.c
clk-ctrl.c
clk-divider.c
clk-gate.c
clk.h
clk-mux.c
clk-sci.c
Kconfig
Makefile
omap4-cm.c

> error: drivers/video/tilcdc-panel.c: No such file or directory
> error: drivers/video/tilcdc-panel.h: No such file or directory
> error: drivers/video/tilcdc.c: No such file or directory
> error: drivers/video/tilcdc.h: No such file or directory
> 

and 
ls drivers/video/ti
am335x-fb.c
am335x-fb.h
Kconfig
Makefile
tilcdc.c
tilcdc.h
tilcdc-panel.c
tilcdc-panel.h

> Does it probably depend on some other patches?
No, the series patch does not depend on other patches
> 
> regards, Felix

Best regards
Dario
Felix Brack Oct. 15, 2020, 8:53 a.m. UTC | #3
Hello Dario,

On 14.10.20 23:22, Dario Binacchi wrote:
> 
>> Il 14/10/2020 10:22 Felix Brack <fb@ltec.ch> ha scritto:
>>
>>  
>> On 11.10.20 14:13, Dario Binacchi wrote:
>>> 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.
>>>
>>> As recommended by Grygorii Strashko I have removed some patches to
>>> upload them in new different series:
>>> - [v2,01/30] clk: remove a redundant header
>>> - [v2,03/30] arch: sandbox: fix typo in clk.h
>>> - [v2,20/30] video: backlight: fix pwm's duty cycle calculation
>>> - [v2,21/30] video: backlight: fix pwm data structure description
>>> - [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
>>> - [v2,23/30] gpio: fix gpio_request_by_name() description
>>>
>>> Grygorii suggested to remove also other patches that I have kept in the
>>> series to allow anyone who wants to be able to test it. Moreover after
>>> the addition of a patch that has largely changed the device tree. The
>>> patches removed are the one and only ones that do not affect the series
>>> in any way. I hope that the next version of this series will require
>>> only minimal changes allowing me to split it according to Grygorii's
>>> suggestions.
>>> ---- 
>>
> 
>> I must be missing something as this patch series does not apply without
>> errors to U-Boot master:
>>
> 
> Hi Felix,
> I applied the patch of the series downloaded from patchwork on master and I compiled it without errors.
> 
Did you do that against a recently cloned master?

>> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
>> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
>> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
>> error: drivers/clk/clk-ti-divider.c: No such file or directory
>> error: drivers/clk/clk-ti-gate.c: No such file or directory
>> error: drivers/clk/clk-ti-mux.c: No such file or directory
>> error: drivers/clk/clk-ti.c: No such file or directory
>> error: drivers/clk/clk-ti.h: No such file or directory
> 
> After applying the patch you should find:
> ls drivers/clk/ti
> am3-prcm.c
> clk-am3-dpll.c
> clk-am3-dpll-x2.c
> clk.c
> clk-ctrl.c
> clk-divider.c
> clk-gate.c
> clk.h
> clk-mux.c
> clk-sci.c
> Kconfig
> Makefile
> omap4-cm.c
> 
>> error: drivers/video/tilcdc-panel.c: No such file or directory
>> error: drivers/video/tilcdc-panel.h: No such file or directory
>> error: drivers/video/tilcdc.c: No such file or directory
>> error: drivers/video/tilcdc.h: No such file or directory
>>
> 
> and 
> ls drivers/video/ti
> am335x-fb.c
> am335x-fb.h
> Kconfig
> Makefile
> tilcdc.c
> tilcdc.h
> tilcdc-panel.c
> tilcdc-panel.h
> 
As the patch series does not apply I don't see these files.

>> Does it probably depend on some other patches?
> No, the series patch does not depend on other patches
>>
>> regards, Felix
> 
> Best regards
> Dario
> 

Two hours ago I did:

1. git clone https://gitlab.denx.de/u-boot/u-boot.git
2. downloaded Add-DM-support-for-omap-PWM-backlight.patch from
   https://patchwork.ozlabs.org/project/uboot/list/?series=207124
3. git apply Add-DM-support-for-omap-PWM-backlight.patch --check -v

result:

Checking patch drivers/clk/clk-divider.c...
Checking patch include/linux/clk-provider.h...
Checking patch include/dt-bindings/bus/ti-sysc.h...
...
Checking patch drivers/clk/ti/Kconfig...
Checking patch drivers/clk/ti/Makefile...
Checking patch drivers/clk/clk-ti-am3-dpll-x2.c =>
drivers/clk/ti/clk-am3-dpll-x2.c...
error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
Checking patch drivers/clk/clk-ti-am3-dpll.c =>
drivers/clk/ti/clk-am3-dpll.c...
error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
Checking patch drivers/clk/clk-ti-ctrl.c => drivers/clk/ti/clk-ctrl.c...
error: drivers/clk/clk-ti-ctrl.c: No such file or directory
Checking patch drivers/clk/clk-ti-divider.c =>
drivers/clk/ti/clk-divider.c...
error: drivers/clk/clk-ti-divider.c: No such file or directory
Checking patch drivers/clk/clk-ti-gate.c => drivers/clk/ti/clk-gate.c...
error: drivers/clk/clk-ti-gate.c: No such file or directory
Checking patch drivers/clk/clk-ti-mux.c => drivers/clk/ti/clk-mux.c...
error: drivers/clk/clk-ti-mux.c: No such file or directory
Checking patch drivers/clk/clk-ti-sci.c => drivers/clk/ti/clk-sci.c...
Checking patch drivers/clk/clk-ti.c => drivers/clk/ti/clk.c...
error: drivers/clk/clk-ti.c: No such file or directory
Checking patch drivers/clk/clk-ti.h => drivers/clk/ti/clk.h...
error: drivers/clk/clk-ti.h: No such file or directory
Checking patch drivers/clk/ti/Makefile...
Checking patch drivers/clk/ti/omap4-cm.c...
Checking patch drivers/clk/ti/Makefile...
Checking patch drivers/clk/ti/am3-prcm.c...
Checking patch arch/sandbox/dts/test.dts...
Checking patch common/fdt_support.c...
Checking patch drivers/core/Kconfig...
Checking patch drivers/core/fdtaddr.c...
Checking patch drivers/core/of_addr.c...
Checking patch drivers/core/ofnode.c...
Checking patch drivers/core/root.c...
Checking patch include/asm-generic/global_data.h...
error: while searching for:
        struct global_data *new_gd;     /* relocated global data */

#ifdef CONFIG_DM
        struct udevice  *dm_root;       /* Root instance for Driver Model */
        struct udevice  *dm_root_f;     /* Pre-relocation root instance */
        struct list_head uclass_root;   /* Head of core tree */

error: patch failed: include/asm-generic/global_data.h:64
error: include/asm-generic/global_data.h: patch does not apply
Checking patch test/dm/test-fdt.c...
Checking patch drivers/timer/omap-timer.c...
Checking patch drivers/misc/Kconfig...
...
Checking patch drivers/video/ti/Kconfig...
Checking patch drivers/video/ti/Makefile...
Checking patch drivers/video/am335x-fb.c => drivers/video/ti/am335x-fb.c...
Checking patch drivers/video/am335x-fb.h => drivers/video/ti/am335x-fb.h...
Checking patch drivers/video/tilcdc-panel.c =>
drivers/video/ti/tilcdc-panel.c...
error: drivers/video/tilcdc-panel.c: No such file or directory
Checking patch drivers/video/tilcdc-panel.h =>
drivers/video/ti/tilcdc-panel.h...
error: drivers/video/tilcdc-panel.h: No such file or directory
Checking patch drivers/video/tilcdc.c => drivers/video/ti/tilcdc.c...
error: drivers/video/tilcdc.c: No such file or directory
Checking patch drivers/video/tilcdc.h => drivers/video/ti/tilcdc.h...
error: drivers/video/tilcdc.h: No such file or directory
Checking patch board/ti/am335x/board.c...
Checking patch board/ti/am43xx/board.c...

Applying the patches 1 to 15 manually works but then patch 16 fails with:

Checking patch arch/sandbox/dts/test.dts...
Checking patch common/fdt_support.c...
Checking patch drivers/core/Kconfig...
Checking patch drivers/core/fdtaddr.c...
Checking patch drivers/core/of_addr.c...
Checking patch drivers/core/ofnode.c...
Checking patch drivers/core/root.c...
Checking patch include/asm-generic/global_data.h...
error: while searching for:
        struct global_data *new_gd;     /* relocated global data */

#ifdef CONFIG_DM
        struct udevice  *dm_root;       /* Root instance for Driver Model */
        struct udevice  *dm_root_f;     /* Pre-relocation root instance */
        struct list_head uclass_root;   /* Head of core tree */

error: patch failed: include/asm-generic/global_data.h:64
error: include/asm-generic/global_data.h: patch does not apply
Checking patch test/dm/test-fdt.c...

The include/asm-generic/global_data.h in the master does not have a line
reading 'struct global_data *new_gd;     /* relocated global data */'.
Line 180 of the master include/asm-generic/global_data.h file however
reads as follows: 'struct global_data *new_gd;'

regards Felix
Dario Binacchi Oct. 15, 2020, 6:56 p.m. UTC | #4
Hi Felix,

> Il 15/10/2020 10:53 Felix Brack <fb@ltec.ch> ha scritto:
> 
>  
> Hello Dario,
> 
> On 14.10.20 23:22, Dario Binacchi wrote:
> > 
> >> Il 14/10/2020 10:22 Felix Brack <fb@ltec.ch> ha scritto:
> >>
> >>  
> >> On 11.10.20 14:13, Dario Binacchi wrote:
> >>> 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.
> >>>
> >>> As recommended by Grygorii Strashko I have removed some patches to
> >>> upload them in new different series:
> >>> - [v2,01/30] clk: remove a redundant header
> >>> - [v2,03/30] arch: sandbox: fix typo in clk.h
> >>> - [v2,20/30] video: backlight: fix pwm's duty cycle calculation
> >>> - [v2,21/30] video: backlight: fix pwm data structure description
> >>> - [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
> >>> - [v2,23/30] gpio: fix gpio_request_by_name() description
> >>>
> >>> Grygorii suggested to remove also other patches that I have kept in the
> >>> series to allow anyone who wants to be able to test it. Moreover after
> >>> the addition of a patch that has largely changed the device tree. The
> >>> patches removed are the one and only ones that do not affect the series
> >>> in any way. I hope that the next version of this series will require
> >>> only minimal changes allowing me to split it according to Grygorii's
> >>> suggestions.
> >>> ---- 
> >>
> > 
> >> I must be missing something as this patch series does not apply without
> >> errors to U-Boot master:
> >>
> > 
> > Hi Felix,
> > I applied the patch of the series downloaded from patchwork on master and I compiled it without errors.
> > 
> Did you do that against a recently cloned master?
> 
> >> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
> >> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
> >> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
> >> error: drivers/clk/clk-ti-divider.c: No such file or directory
> >> error: drivers/clk/clk-ti-gate.c: No such file or directory
> >> error: drivers/clk/clk-ti-mux.c: No such file or directory
> >> error: drivers/clk/clk-ti.c: No such file or directory
> >> error: drivers/clk/clk-ti.h: No such file or directory
> > 
> > After applying the patch you should find:
> > ls drivers/clk/ti
> > am3-prcm.c
> > clk-am3-dpll.c
> > clk-am3-dpll-x2.c
> > clk.c
> > clk-ctrl.c
> > clk-divider.c
> > clk-gate.c
> > clk.h
> > clk-mux.c
> > clk-sci.c
> > Kconfig
> > Makefile
> > omap4-cm.c
> > 
> >> error: drivers/video/tilcdc-panel.c: No such file or directory
> >> error: drivers/video/tilcdc-panel.h: No such file or directory
> >> error: drivers/video/tilcdc.c: No such file or directory
> >> error: drivers/video/tilcdc.h: No such file or directory
> >>
> > 
> > and 
> > ls drivers/video/ti
> > am335x-fb.c
> > am335x-fb.h
> > Kconfig
> > Makefile
> > tilcdc.c
> > tilcdc.h
> > tilcdc-panel.c
> > tilcdc-panel.h
> > 
> As the patch series does not apply I don't see these files.
> 
> >> Does it probably depend on some other patches?
> > No, the series patch does not depend on other patches
> >>
> >> regards, Felix
> > 
> > Best regards
> > Dario
> > 
> 
> Two hours ago I did:
> 
> 1. git clone https://gitlab.denx.de/u-boot/u-boot.git
> 2. downloaded Add-DM-support-for-omap-PWM-backlight.patch from
>    https://patchwork.ozlabs.org/project/uboot/list/?series=207124
> 3. git apply Add-DM-support-for-omap-PWM-backlight.patch --check -v
> 
> result:
> 
> Checking patch drivers/clk/clk-divider.c...
> Checking patch include/linux/clk-provider.h...
> Checking patch include/dt-bindings/bus/ti-sysc.h...
> ...
> Checking patch drivers/clk/ti/Kconfig...
> Checking patch drivers/clk/ti/Makefile...
> Checking patch drivers/clk/clk-ti-am3-dpll-x2.c =>
> drivers/clk/ti/clk-am3-dpll-x2.c...
> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
> Checking patch drivers/clk/clk-ti-am3-dpll.c =>
> drivers/clk/ti/clk-am3-dpll.c...
> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
> Checking patch drivers/clk/clk-ti-ctrl.c => drivers/clk/ti/clk-ctrl.c...
> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
> Checking patch drivers/clk/clk-ti-divider.c =>
> drivers/clk/ti/clk-divider.c...
> error: drivers/clk/clk-ti-divider.c: No such file or directory
> Checking patch drivers/clk/clk-ti-gate.c => drivers/clk/ti/clk-gate.c...
> error: drivers/clk/clk-ti-gate.c: No such file or directory
> Checking patch drivers/clk/clk-ti-mux.c => drivers/clk/ti/clk-mux.c...
> error: drivers/clk/clk-ti-mux.c: No such file or directory
> Checking patch drivers/clk/clk-ti-sci.c => drivers/clk/ti/clk-sci.c...
> Checking patch drivers/clk/clk-ti.c => drivers/clk/ti/clk.c...
> error: drivers/clk/clk-ti.c: No such file or directory
> Checking patch drivers/clk/clk-ti.h => drivers/clk/ti/clk.h...
> error: drivers/clk/clk-ti.h: No such file or directory
> Checking patch drivers/clk/ti/Makefile...
> Checking patch drivers/clk/ti/omap4-cm.c...
> Checking patch drivers/clk/ti/Makefile...
> Checking patch drivers/clk/ti/am3-prcm.c...
> Checking patch arch/sandbox/dts/test.dts...
> Checking patch common/fdt_support.c...
> Checking patch drivers/core/Kconfig...
> Checking patch drivers/core/fdtaddr.c...
> Checking patch drivers/core/of_addr.c...
> Checking patch drivers/core/ofnode.c...
> Checking patch drivers/core/root.c...
> Checking patch include/asm-generic/global_data.h...
> error: while searching for:
>         struct global_data *new_gd;     /* relocated global data */
> 
> #ifdef CONFIG_DM
>         struct udevice  *dm_root;       /* Root instance for Driver Model */
>         struct udevice  *dm_root_f;     /* Pre-relocation root instance */
>         struct list_head uclass_root;   /* Head of core tree */
> 
> error: patch failed: include/asm-generic/global_data.h:64
> error: include/asm-generic/global_data.h: patch does not apply
> Checking patch test/dm/test-fdt.c...
> Checking patch drivers/timer/omap-timer.c...
> Checking patch drivers/misc/Kconfig...
> ...
> Checking patch drivers/video/ti/Kconfig...
> Checking patch drivers/video/ti/Makefile...
> Checking patch drivers/video/am335x-fb.c => drivers/video/ti/am335x-fb.c...
> Checking patch drivers/video/am335x-fb.h => drivers/video/ti/am335x-fb.h...
> Checking patch drivers/video/tilcdc-panel.c =>
> drivers/video/ti/tilcdc-panel.c...
> error: drivers/video/tilcdc-panel.c: No such file or directory
> Checking patch drivers/video/tilcdc-panel.h =>
> drivers/video/ti/tilcdc-panel.h...
> error: drivers/video/tilcdc-panel.h: No such file or directory
> Checking patch drivers/video/tilcdc.c => drivers/video/ti/tilcdc.c...
> error: drivers/video/tilcdc.c: No such file or directory
> Checking patch drivers/video/tilcdc.h => drivers/video/ti/tilcdc.h...
> error: drivers/video/tilcdc.h: No such file or directory
> Checking patch board/ti/am335x/board.c...
> Checking patch board/ti/am43xx/board.c...
> 
> Applying the patches 1 to 15 manually works but then patch 16 fails with:
> 
> Checking patch arch/sandbox/dts/test.dts...
> Checking patch common/fdt_support.c...
> Checking patch drivers/core/Kconfig...
> Checking patch drivers/core/fdtaddr.c...
> Checking patch drivers/core/of_addr.c...
> Checking patch drivers/core/ofnode.c...
> Checking patch drivers/core/root.c...
> Checking patch include/asm-generic/global_data.h...
> error: while searching for:
>         struct global_data *new_gd;     /* relocated global data */
> 
> #ifdef CONFIG_DM
>         struct udevice  *dm_root;       /* Root instance for Driver Model */
>         struct udevice  *dm_root_f;     /* Pre-relocation root instance */
>         struct list_head uclass_root;   /* Head of core tree */
> 
> error: patch failed: include/asm-generic/global_data.h:64
> error: include/asm-generic/global_data.h: patch does not apply
> Checking patch test/dm/test-fdt.c...
> 
> The include/asm-generic/global_data.h in the master does not have a line
> reading 'struct global_data *new_gd;     /* relocated global data */'.
> Line 180 of the master include/asm-generic/global_data.h file however
> reads as follows: 'struct global_data *new_gd;'
> 
> regards Felix

Try with:
1. cd /tmp
2. git clone https://gitlab.denx.de/u-boot/u-boot.git
3. cd /tmp/u-boot
4. git checkout -b omap-pwm 9885313b9a
5. git am Add-DM-support-for-omap-PWM-backlight.patch

Regards,
Dario
Felix Brack Oct. 16, 2020, 8:41 a.m. UTC | #5
Hello Dario,

On 15.10.20 20:56, Dario Binacchi wrote:
> Hi Felix,
> 
>> Il 15/10/2020 10:53 Felix Brack <fb@ltec.ch> ha scritto:
>>
>>  
>> Hello Dario,
>>
>> On 14.10.20 23:22, Dario Binacchi wrote:
>>>
>>>> Il 14/10/2020 10:22 Felix Brack <fb@ltec.ch> ha scritto:
>>>>
>>>>  
>>>> On 11.10.20 14:13, Dario Binacchi wrote:
>>>>> 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.
>>>>>
>>>>> As recommended by Grygorii Strashko I have removed some patches to
>>>>> upload them in new different series:
>>>>> - [v2,01/30] clk: remove a redundant header
>>>>> - [v2,03/30] arch: sandbox: fix typo in clk.h
>>>>> - [v2,20/30] video: backlight: fix pwm's duty cycle calculation
>>>>> - [v2,21/30] video: backlight: fix pwm data structure description
>>>>> - [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
>>>>> - [v2,23/30] gpio: fix gpio_request_by_name() description
>>>>>
>>>>> Grygorii suggested to remove also other patches that I have kept in the
>>>>> series to allow anyone who wants to be able to test it. Moreover after
>>>>> the addition of a patch that has largely changed the device tree. The
>>>>> patches removed are the one and only ones that do not affect the series
>>>>> in any way. I hope that the next version of this series will require
>>>>> only minimal changes allowing me to split it according to Grygorii's
>>>>> suggestions.
>>>>> ---- 
>>>>
>>>
>>>> I must be missing something as this patch series does not apply without
>>>> errors to U-Boot master:
>>>>
>>>
>>> Hi Felix,
>>> I applied the patch of the series downloaded from patchwork on master and I compiled it without errors.
>>>
>> Did you do that against a recently cloned master?
>>
>>>> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
>>>> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
>>>> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
>>>> error: drivers/clk/clk-ti-divider.c: No such file or directory
>>>> error: drivers/clk/clk-ti-gate.c: No such file or directory
>>>> error: drivers/clk/clk-ti-mux.c: No such file or directory
>>>> error: drivers/clk/clk-ti.c: No such file or directory
>>>> error: drivers/clk/clk-ti.h: No such file or directory
>>>
>>> After applying the patch you should find:
>>> ls drivers/clk/ti
>>> am3-prcm.c
>>> clk-am3-dpll.c
>>> clk-am3-dpll-x2.c
>>> clk.c
>>> clk-ctrl.c
>>> clk-divider.c
>>> clk-gate.c
>>> clk.h
>>> clk-mux.c
>>> clk-sci.c
>>> Kconfig
>>> Makefile
>>> omap4-cm.c
>>>
>>>> error: drivers/video/tilcdc-panel.c: No such file or directory
>>>> error: drivers/video/tilcdc-panel.h: No such file or directory
>>>> error: drivers/video/tilcdc.c: No such file or directory
>>>> error: drivers/video/tilcdc.h: No such file or directory
>>>>
>>>
>>> and 
>>> ls drivers/video/ti
>>> am335x-fb.c
>>> am335x-fb.h
>>> Kconfig
>>> Makefile
>>> tilcdc.c
>>> tilcdc.h
>>> tilcdc-panel.c
>>> tilcdc-panel.h
>>>
>> As the patch series does not apply I don't see these files.
>>
>>>> Does it probably depend on some other patches?
>>> No, the series patch does not depend on other patches
>>>>
>>>> regards, Felix
>>>
>>> Best regards
>>> Dario
>>>
>>
>> Two hours ago I did:
>>
>> 1. git clone https://gitlab.denx.de/u-boot/u-boot.git
>> 2. downloaded Add-DM-support-for-omap-PWM-backlight.patch from
>>    https://patchwork.ozlabs.org/project/uboot/list/?series=207124
>> 3. git apply Add-DM-support-for-omap-PWM-backlight.patch --check -v
>>
>> result:
>>
>> Checking patch drivers/clk/clk-divider.c...
>> Checking patch include/linux/clk-provider.h...
>> Checking patch include/dt-bindings/bus/ti-sysc.h...
>> ...
>> Checking patch drivers/clk/ti/Kconfig...
>> Checking patch drivers/clk/ti/Makefile...
>> Checking patch drivers/clk/clk-ti-am3-dpll-x2.c =>
>> drivers/clk/ti/clk-am3-dpll-x2.c...
>> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
>> Checking patch drivers/clk/clk-ti-am3-dpll.c =>
>> drivers/clk/ti/clk-am3-dpll.c...
>> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
>> Checking patch drivers/clk/clk-ti-ctrl.c => drivers/clk/ti/clk-ctrl.c...
>> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
>> Checking patch drivers/clk/clk-ti-divider.c =>
>> drivers/clk/ti/clk-divider.c...
>> error: drivers/clk/clk-ti-divider.c: No such file or directory
>> Checking patch drivers/clk/clk-ti-gate.c => drivers/clk/ti/clk-gate.c...
>> error: drivers/clk/clk-ti-gate.c: No such file or directory
>> Checking patch drivers/clk/clk-ti-mux.c => drivers/clk/ti/clk-mux.c...
>> error: drivers/clk/clk-ti-mux.c: No such file or directory
>> Checking patch drivers/clk/clk-ti-sci.c => drivers/clk/ti/clk-sci.c...
>> Checking patch drivers/clk/clk-ti.c => drivers/clk/ti/clk.c...
>> error: drivers/clk/clk-ti.c: No such file or directory
>> Checking patch drivers/clk/clk-ti.h => drivers/clk/ti/clk.h...
>> error: drivers/clk/clk-ti.h: No such file or directory
>> Checking patch drivers/clk/ti/Makefile...
>> Checking patch drivers/clk/ti/omap4-cm.c...
>> Checking patch drivers/clk/ti/Makefile...
>> Checking patch drivers/clk/ti/am3-prcm.c...
>> Checking patch arch/sandbox/dts/test.dts...
>> Checking patch common/fdt_support.c...
>> Checking patch drivers/core/Kconfig...
>> Checking patch drivers/core/fdtaddr.c...
>> Checking patch drivers/core/of_addr.c...
>> Checking patch drivers/core/ofnode.c...
>> Checking patch drivers/core/root.c...
>> Checking patch include/asm-generic/global_data.h...
>> error: while searching for:
>>         struct global_data *new_gd;     /* relocated global data */
>>
>> #ifdef CONFIG_DM
>>         struct udevice  *dm_root;       /* Root instance for Driver Model */
>>         struct udevice  *dm_root_f;     /* Pre-relocation root instance */
>>         struct list_head uclass_root;   /* Head of core tree */
>>
>> error: patch failed: include/asm-generic/global_data.h:64
>> error: include/asm-generic/global_data.h: patch does not apply
>> Checking patch test/dm/test-fdt.c...
>> Checking patch drivers/timer/omap-timer.c...
>> Checking patch drivers/misc/Kconfig...
>> ...
>> Checking patch drivers/video/ti/Kconfig...
>> Checking patch drivers/video/ti/Makefile...
>> Checking patch drivers/video/am335x-fb.c => drivers/video/ti/am335x-fb.c...
>> Checking patch drivers/video/am335x-fb.h => drivers/video/ti/am335x-fb.h...
>> Checking patch drivers/video/tilcdc-panel.c =>
>> drivers/video/ti/tilcdc-panel.c...
>> error: drivers/video/tilcdc-panel.c: No such file or directory
>> Checking patch drivers/video/tilcdc-panel.h =>
>> drivers/video/ti/tilcdc-panel.h...
>> error: drivers/video/tilcdc-panel.h: No such file or directory
>> Checking patch drivers/video/tilcdc.c => drivers/video/ti/tilcdc.c...
>> error: drivers/video/tilcdc.c: No such file or directory
>> Checking patch drivers/video/tilcdc.h => drivers/video/ti/tilcdc.h...
>> error: drivers/video/tilcdc.h: No such file or directory
>> Checking patch board/ti/am335x/board.c...
>> Checking patch board/ti/am43xx/board.c...
>>
>> Applying the patches 1 to 15 manually works but then patch 16 fails with:
>>
>> Checking patch arch/sandbox/dts/test.dts...
>> Checking patch common/fdt_support.c...
>> Checking patch drivers/core/Kconfig...
>> Checking patch drivers/core/fdtaddr.c...
>> Checking patch drivers/core/of_addr.c...
>> Checking patch drivers/core/ofnode.c...
>> Checking patch drivers/core/root.c...
>> Checking patch include/asm-generic/global_data.h...
>> error: while searching for:
>>         struct global_data *new_gd;     /* relocated global data */
>>
>> #ifdef CONFIG_DM
>>         struct udevice  *dm_root;       /* Root instance for Driver Model */
>>         struct udevice  *dm_root_f;     /* Pre-relocation root instance */
>>         struct list_head uclass_root;   /* Head of core tree */
>>
>> error: patch failed: include/asm-generic/global_data.h:64
>> error: include/asm-generic/global_data.h: patch does not apply
>> Checking patch test/dm/test-fdt.c...
>>
>> The include/asm-generic/global_data.h in the master does not have a line
>> reading 'struct global_data *new_gd;     /* relocated global data */'.
>> Line 180 of the master include/asm-generic/global_data.h file however
>> reads as follows: 'struct global_data *new_gd;'
>>
>> regards Felix
> 
> Try with:
> 1. cd /tmp
> 2. git clone https://gitlab.denx.de/u-boot/u-boot.git
> 3. cd /tmp/u-boot
> 4. git checkout -b omap-pwm 9885313b9a
No, I won't. It will be a pleasure to me testing this patch series on
the board I'm maintaining, but only after it applies cleanly to the HEAD
of the U-Boot master branch. Meanwhile I suggest you add a comment about
the required starting point in the repository to all future versions of
this patch series.

> 5. git am Add-DM-support-for-omap-PWM-backlight.patch
> 
> Regards,
> Dario
> 

regards, Felix
Dario Binacchi Oct. 16, 2020, 8:31 p.m. UTC | #6
Hi Felix,

> Il 16/10/2020 10:41 Felix Brack <fb@ltec.ch> ha scritto:
> 
>  
> Hello Dario,
> 
> On 15.10.20 20:56, Dario Binacchi wrote:
> > Hi Felix,
> > 
> >> Il 15/10/2020 10:53 Felix Brack <fb@ltec.ch> ha scritto:
> >>
> >>  
> >> Hello Dario,
> >>
> >> On 14.10.20 23:22, Dario Binacchi wrote:
> >>>
> >>>> Il 14/10/2020 10:22 Felix Brack <fb@ltec.ch> ha scritto:
> >>>>
> >>>>  
> >>>> On 11.10.20 14:13, Dario Binacchi wrote:
> >>>>> 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.
> >>>>>
> >>>>> As recommended by Grygorii Strashko I have removed some patches to
> >>>>> upload them in new different series:
> >>>>> - [v2,01/30] clk: remove a redundant header
> >>>>> - [v2,03/30] arch: sandbox: fix typo in clk.h
> >>>>> - [v2,20/30] video: backlight: fix pwm's duty cycle calculation
> >>>>> - [v2,21/30] video: backlight: fix pwm data structure description
> >>>>> - [v2,22/30] dm: core: improve uclass_get_device_by_phandle_id() description
> >>>>> - [v2,23/30] gpio: fix gpio_request_by_name() description
> >>>>>
> >>>>> Grygorii suggested to remove also other patches that I have kept in the
> >>>>> series to allow anyone who wants to be able to test it. Moreover after
> >>>>> the addition of a patch that has largely changed the device tree. The
> >>>>> patches removed are the one and only ones that do not affect the series
> >>>>> in any way. I hope that the next version of this series will require
> >>>>> only minimal changes allowing me to split it according to Grygorii's
> >>>>> suggestions.
> >>>>> ---- 
> >>>>
> >>>
> >>>> I must be missing something as this patch series does not apply without
> >>>> errors to U-Boot master:
> >>>>
> >>>
> >>> Hi Felix,
> >>> I applied the patch of the series downloaded from patchwork on master and I compiled it without errors.
> >>>
> >> Did you do that against a recently cloned master?
> >>
> >>>> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
> >>>> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
> >>>> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
> >>>> error: drivers/clk/clk-ti-divider.c: No such file or directory
> >>>> error: drivers/clk/clk-ti-gate.c: No such file or directory
> >>>> error: drivers/clk/clk-ti-mux.c: No such file or directory
> >>>> error: drivers/clk/clk-ti.c: No such file or directory
> >>>> error: drivers/clk/clk-ti.h: No such file or directory
> >>>
> >>> After applying the patch you should find:
> >>> ls drivers/clk/ti
> >>> am3-prcm.c
> >>> clk-am3-dpll.c
> >>> clk-am3-dpll-x2.c
> >>> clk.c
> >>> clk-ctrl.c
> >>> clk-divider.c
> >>> clk-gate.c
> >>> clk.h
> >>> clk-mux.c
> >>> clk-sci.c
> >>> Kconfig
> >>> Makefile
> >>> omap4-cm.c
> >>>
> >>>> error: drivers/video/tilcdc-panel.c: No such file or directory
> >>>> error: drivers/video/tilcdc-panel.h: No such file or directory
> >>>> error: drivers/video/tilcdc.c: No such file or directory
> >>>> error: drivers/video/tilcdc.h: No such file or directory
> >>>>
> >>>
> >>> and 
> >>> ls drivers/video/ti
> >>> am335x-fb.c
> >>> am335x-fb.h
> >>> Kconfig
> >>> Makefile
> >>> tilcdc.c
> >>> tilcdc.h
> >>> tilcdc-panel.c
> >>> tilcdc-panel.h
> >>>
> >> As the patch series does not apply I don't see these files.
> >>
> >>>> Does it probably depend on some other patches?
> >>> No, the series patch does not depend on other patches
> >>>>
> >>>> regards, Felix
> >>>
> >>> Best regards
> >>> Dario
> >>>
> >>
> >> Two hours ago I did:
> >>
> >> 1. git clone https://gitlab.denx.de/u-boot/u-boot.git
> >> 2. downloaded Add-DM-support-for-omap-PWM-backlight.patch from
> >>    https://patchwork.ozlabs.org/project/uboot/list/?series=207124
> >> 3. git apply Add-DM-support-for-omap-PWM-backlight.patch --check -v
> >>
> >> result:
> >>
> >> Checking patch drivers/clk/clk-divider.c...
> >> Checking patch include/linux/clk-provider.h...
> >> Checking patch include/dt-bindings/bus/ti-sysc.h...
> >> ...
> >> Checking patch drivers/clk/ti/Kconfig...
> >> Checking patch drivers/clk/ti/Makefile...
> >> Checking patch drivers/clk/clk-ti-am3-dpll-x2.c =>
> >> drivers/clk/ti/clk-am3-dpll-x2.c...
> >> error: drivers/clk/clk-ti-am3-dpll-x2.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti-am3-dpll.c =>
> >> drivers/clk/ti/clk-am3-dpll.c...
> >> error: drivers/clk/clk-ti-am3-dpll.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti-ctrl.c => drivers/clk/ti/clk-ctrl.c...
> >> error: drivers/clk/clk-ti-ctrl.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti-divider.c =>
> >> drivers/clk/ti/clk-divider.c...
> >> error: drivers/clk/clk-ti-divider.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti-gate.c => drivers/clk/ti/clk-gate.c...
> >> error: drivers/clk/clk-ti-gate.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti-mux.c => drivers/clk/ti/clk-mux.c...
> >> error: drivers/clk/clk-ti-mux.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti-sci.c => drivers/clk/ti/clk-sci.c...
> >> Checking patch drivers/clk/clk-ti.c => drivers/clk/ti/clk.c...
> >> error: drivers/clk/clk-ti.c: No such file or directory
> >> Checking patch drivers/clk/clk-ti.h => drivers/clk/ti/clk.h...
> >> error: drivers/clk/clk-ti.h: No such file or directory
> >> Checking patch drivers/clk/ti/Makefile...
> >> Checking patch drivers/clk/ti/omap4-cm.c...
> >> Checking patch drivers/clk/ti/Makefile...
> >> Checking patch drivers/clk/ti/am3-prcm.c...
> >> Checking patch arch/sandbox/dts/test.dts...
> >> Checking patch common/fdt_support.c...
> >> Checking patch drivers/core/Kconfig...
> >> Checking patch drivers/core/fdtaddr.c...
> >> Checking patch drivers/core/of_addr.c...
> >> Checking patch drivers/core/ofnode.c...
> >> Checking patch drivers/core/root.c...
> >> Checking patch include/asm-generic/global_data.h...
> >> error: while searching for:
> >>         struct global_data *new_gd;     /* relocated global data */
> >>
> >> #ifdef CONFIG_DM
> >>         struct udevice  *dm_root;       /* Root instance for Driver Model */
> >>         struct udevice  *dm_root_f;     /* Pre-relocation root instance */
> >>         struct list_head uclass_root;   /* Head of core tree */
> >>
> >> error: patch failed: include/asm-generic/global_data.h:64
> >> error: include/asm-generic/global_data.h: patch does not apply
> >> Checking patch test/dm/test-fdt.c...
> >> Checking patch drivers/timer/omap-timer.c...
> >> Checking patch drivers/misc/Kconfig...
> >> ...
> >> Checking patch drivers/video/ti/Kconfig...
> >> Checking patch drivers/video/ti/Makefile...
> >> Checking patch drivers/video/am335x-fb.c => drivers/video/ti/am335x-fb.c...
> >> Checking patch drivers/video/am335x-fb.h => drivers/video/ti/am335x-fb.h...
> >> Checking patch drivers/video/tilcdc-panel.c =>
> >> drivers/video/ti/tilcdc-panel.c...
> >> error: drivers/video/tilcdc-panel.c: No such file or directory
> >> Checking patch drivers/video/tilcdc-panel.h =>
> >> drivers/video/ti/tilcdc-panel.h...
> >> error: drivers/video/tilcdc-panel.h: No such file or directory
> >> Checking patch drivers/video/tilcdc.c => drivers/video/ti/tilcdc.c...
> >> error: drivers/video/tilcdc.c: No such file or directory
> >> Checking patch drivers/video/tilcdc.h => drivers/video/ti/tilcdc.h...
> >> error: drivers/video/tilcdc.h: No such file or directory
> >> Checking patch board/ti/am335x/board.c...
> >> Checking patch board/ti/am43xx/board.c...
> >>
> >> Applying the patches 1 to 15 manually works but then patch 16 fails with:
> >>
> >> Checking patch arch/sandbox/dts/test.dts...
> >> Checking patch common/fdt_support.c...
> >> Checking patch drivers/core/Kconfig...
> >> Checking patch drivers/core/fdtaddr.c...
> >> Checking patch drivers/core/of_addr.c...
> >> Checking patch drivers/core/ofnode.c...
> >> Checking patch drivers/core/root.c...
> >> Checking patch include/asm-generic/global_data.h...
> >> error: while searching for:
> >>         struct global_data *new_gd;     /* relocated global data */
> >>
> >> #ifdef CONFIG_DM
> >>         struct udevice  *dm_root;       /* Root instance for Driver Model */
> >>         struct udevice  *dm_root_f;     /* Pre-relocation root instance */
> >>         struct list_head uclass_root;   /* Head of core tree */
> >>
> >> error: patch failed: include/asm-generic/global_data.h:64
> >> error: include/asm-generic/global_data.h: patch does not apply
> >> Checking patch test/dm/test-fdt.c...
> >>
> >> The include/asm-generic/global_data.h in the master does not have a line
> >> reading 'struct global_data *new_gd;     /* relocated global data */'.
> >> Line 180 of the master include/asm-generic/global_data.h file however
> >> reads as follows: 'struct global_data *new_gd;'
> >>
> >> regards Felix
> > 
> > Try with:
> > 1. cd /tmp
> > 2. git clone https://gitlab.denx.de/u-boot/u-boot.git
> > 3. cd /tmp/u-boot
> > 4. git checkout -b omap-pwm 9885313b9a
> No, I won't. 

Commit 9885313b9a was the HEAD of the master branch no more than a week ago when I uploaded the series. The series is made up of 27 patches, so it is not surprising that there is some conflict a week later if you want to apply the series to the HEAD of the master branch. As you can see, the commit 9885313b9a is dated 12 October 2020.

> It will be a pleasure to me testing this patch series on
> the board I'm maintaining, 

I appreciate it and I thank you

> but only after it applies cleanly to the HEAD
> of the U-Boot master branch. 

However if this is a problem, I will rebase the patch series on master and upload it to patchwork as version 4.

> Meanwhile I suggest you add a comment about
> the required starting point in the repository to all future versions of
> this patch series.

I'll do it for the next versions.

> 
> > 5. git am Add-DM-support-for-omap-PWM-backlight.patch
> > 
> > Regards,
> > Dario
> > 
> 
> regards, Felix

Regards,
Dario