mbox series

[0/2] ARM: dts: am335x: Replace numeric pinmux address with macro defines

Message ID 20190313142724.27446-1-cquast@hanoverdisplays.com (mailing list archive)
Headers show
Series ARM: dts: am335x: Replace numeric pinmux address with macro defines | expand

Message

Christina Quast March 13, 2019, 2:27 p.m. UTC
This patchset replaces the register offsets for am335x with macro defines.
The values are extraced from the "AM335x SitaraTM Processors Technical
Reference Manual".

Updated AM33XX_IOPAD to take three instead of two parameters, to make
future changes to #pinctrl-cells easier.

Christina Quast (2):
  ARM: dts: am335x: Replace numeric pinmux address with macro defines
  ARM: dts: am335x: Replaced register offsets with defines

 arch/arm/boot/dts/am335x-baltos-ir2110.dts    |  16 +-
 arch/arm/boot/dts/am335x-baltos-ir3220.dts    |  38 +--
 arch/arm/boot/dts/am335x-baltos-ir5221.dts    |  42 +--
 arch/arm/boot/dts/am335x-baltos-leds.dtsi     |   6 +-
 arch/arm/boot/dts/am335x-baltos.dtsi          | 140 ++++-----
 arch/arm/boot/dts/am335x-base0033.dts         |  48 +--
 arch/arm/boot/dts/am335x-bone-common.dtsi     | 116 +++----
 .../arm/boot/dts/am335x-boneblack-common.dtsi |  54 ++--
 .../boot/dts/am335x-boneblack-wireless.dts    |  28 +-
 arch/arm/boot/dts/am335x-boneblue.dts         | 104 +++----
 .../arm/boot/dts/am335x-bonegreen-common.dtsi |   4 +-
 .../boot/dts/am335x-bonegreen-wireless.dts    |  28 +-
 arch/arm/boot/dts/am335x-chiliboard.dts       |  66 ++--
 arch/arm/boot/dts/am335x-chilisom.dtsi        |  34 +-
 arch/arm/boot/dts/am335x-cm-t335.dts          | 154 ++++-----
 arch/arm/boot/dts/am335x-evm.dts              | 234 +++++++-------
 arch/arm/boot/dts/am335x-evmsk.dts            | 292 +++++++++---------
 arch/arm/boot/dts/am335x-icev2.dts            | 116 +++----
 arch/arm/boot/dts/am335x-igep0033.dtsi        |  40 +--
 arch/arm/boot/dts/am335x-lxm.dts              | 120 +++----
 .../boot/dts/am335x-moxa-uc-2100-common.dtsi  |  42 +--
 arch/arm/boot/dts/am335x-moxa-uc-2101.dts     |  24 +-
 .../arm/boot/dts/am335x-moxa-uc-8100-me-t.dts | 116 +++----
 arch/arm/boot/dts/am335x-nano.dts             | 140 ++++-----
 arch/arm/boot/dts/am335x-osd3358-sm-red.dts   | 168 +++++-----
 arch/arm/boot/dts/am335x-osd335x-common.dtsi  |   4 +-
 arch/arm/boot/dts/am335x-pcm-953.dtsi         |  74 ++---
 arch/arm/boot/dts/am335x-pdu001.dts           | 170 +++++-----
 arch/arm/boot/dts/am335x-pepper.dts           | 200 ++++++------
 arch/arm/boot/dts/am335x-phycore-som.dtsi     |  60 ++--
 arch/arm/boot/dts/am335x-pocketbeagle.dts     |  56 ++--
 arch/arm/boot/dts/am335x-sancloud-bbe.dts     |  62 ++--
 arch/arm/boot/dts/am335x-sbc-t335.dts         | 112 +++----
 arch/arm/boot/dts/am335x-shc.dts              | 224 +++++++-------
 arch/arm/boot/dts/am335x-sl50.dts             | 208 ++++++-------
 arch/arm/boot/dts/am335x-wega.dtsi            |  68 ++--
 arch/arm/boot/dts/am33xx.dtsi                 |   1 +
 include/dt-bindings/pinctrl/am335x.h          | 236 ++++++++++++++
 include/dt-bindings/pinctrl/omap.h            |   2 +-
 39 files changed, 1942 insertions(+), 1705 deletions(-)
 create mode 100644 include/dt-bindings/pinctrl/am335x.h

Comments

Tony Lindgren March 14, 2019, 3:05 p.m. UTC | #1
* Christina Quast <cquast@hanoverdisplays.com> [190313 14:28]:
> The defines are taken from dt-bindings/pinctrl/am335x.h
> 
> Updated AM33XX_IOPAD to take three instead of two parameters:
> AM33XX_IOPAD(register_offset, pin_direction_pullups, mux_mode)

Thanks that works great for making things work eventually
with #pinctrl-cells = <2> :)

> +			AM33XX_IOPAD(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0)      /* uart1_rxd */
> +			AM33XX_IOPAD(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0)      /* uart1_txd *

Since it sounds like you're modifying these with a script,
just leave out any nop comments while at it where the comment
is just the pad name already there in the new register
define. Some comments might need to be preserved, but my
guess is that they're mostly just the pad name.

And I suggest you split this change to a seprate patch
for each board so in case of trouble we can revert the
changes for a single board if needed.

Regards,

Tony
Tony Lindgren March 14, 2019, 4:12 p.m. UTC | #2
* Christina Quast <cquast@hanoverdisplays.com> [190314 16:03]:
> On 14/03/2019 16:05, Tony Lindgren wrote:
> > * Christina Quast <cquast@hanoverdisplays.com> [190313 14:28]:
> >> The defines are taken from dt-bindings/pinctrl/am335x.h
> >>
> >> Updated AM33XX_IOPAD to take three instead of two parameters:
> >> AM33XX_IOPAD(register_offset, pin_direction_pullups, mux_mode)
> > Thanks that works great for making things work eventually
> > with #pinctrl-cells = <2> :)
> >
> >> +			AM33XX_IOPAD(AM335X_PIN_UART1_RXD, PIN_INPUT, MUX_MODE0)      /* uart1_rxd */
> >> +			AM33XX_IOPAD(AM335X_PIN_UART1_TXD, PIN_INPUT, MUX_MODE0)      /* uart1_txd *
> > Since it sounds like you're modifying these with a script,
> Who would do such a change by hand, anyways? That's too error-prone!

Right :)

> > just leave out any nop comments while at it where the comment
> > is just the pad name already there in the new register
> > define. Some comments might need to be preserved, but my
> > guess is that they're mostly just the pad name.
> >
> > And I suggest you split this change to a seprate patch
> > for each board so in case of trouble we can revert the
> > changes for a single board if needed.
> Is it really useful to have a change per board? Once the AM33XX_IOPAD
> macro is changed and takes 3 arguments instead of 2, the old boards will
> not compile anymore anyways.

That's a good point. How about use some different name for
the new macro? Something like AM33XX_PADCONF maybe?

Note that there is a huge number of out-of-tree board specific
dts files for various devices. So let's also keep the old
macro for now. We could make produce a warning, then we can
drop it later on few merge cycles later.

Regards,

Tony