mbox series

[00/12] Add support for Orange Pi 3

Message ID 20190405234514.6183-1-megous@megous.com (mailing list archive)
Headers show
Series Add support for Orange Pi 3 | expand

Message

Ondřej Jirman April 5, 2019, 11:45 p.m. UTC
From: Ondrej Jirman <megous@megous.com>

This series implements support for Xunlong Orange Pi 3 board.

Unfortunately, this board needs some small driver patches, so I have
split the boards DT patch into chunks that require patches for drivers
in various subsystems:

- Basic DT for the board  (patch 1)
- HDMI support            (patches 2, 3, 4)
- Ethernet support        (patches 5, 6, 7)
- WiFi support            (patches 8, 9, 10, 11, 12)

This patch is also needed to not get segfault on boot: 
  https://lkml.org/lkml/2019/4/5/856

Please take a look.

regards,
  Ondrej Jirman

Icenowy Zheng (2):
  net: stmmac: sun8i: add support for Allwinner H6 EMAC
  net: stmmac: sun8i: force select external PHY when no internal one

Ondrej Jirman (10):
  arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
  drm: sun4i: Add support for enabling DDC I2C bus to dw_hdmi glue
  dt-bindings: display: sun4i-drm: Add DDC power supply
  arm64: dts: allwinner: orange-pi-3: Enable HDMI output
  arm64: dts: allwinner: orange-pi-3: Enable ethernet
  arm64: dts: allwinner: h6: Add MMC1 pins
  pinctrl: sunxi: Prepare for alternative bias voltage setting methods
  pinctrl: sunxi: Support I/O bias voltage setting on H6
  brcmfmac: Loading the correct firmware for brcm43456
  arm64: dts: allwinner: orange-pi-3: Enable WiFi

 .../bindings/display/sunxi/sun4i-drm.txt      |   1 +
 arch/arm64/boot/dts/allwinner/Makefile        |   1 +
 .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 339 ++++++++++++++++++
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  |   9 +
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         |  17 +-
 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h         |   1 +
 .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c |  22 ++
 .../broadcom/brcm80211/brcmfmac/sdio.c        |   4 +-
 drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c     |   1 +
 drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c     |   2 +-
 drivers/pinctrl/sunxi/pinctrl-sunxi.c         |  50 ++-
 drivers/pinctrl/sunxi/pinctrl-sunxi.h         |   7 +-
 12 files changed, 433 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts

Comments

Ondřej Jirman April 7, 2019, 2:32 p.m. UTC | #1
On Sun, Apr 07, 2019 at 03:36:21PM +0200, Clément Péron wrote:
> Hi,
> 
> On Sat, 6 Apr 2019 at 01:45, megous via linux-sunxi
> <linux-sunxi@googlegroups.com> wrote:
> >
> > From: Ondrej Jirman <megous@megous.com>
> >
> > This series implements support for Xunlong Orange Pi 3 board.
> 
> OrangePi 3 Lite2 and One Plus boards support has already been merged.
> The support is not complete but you should rebase your patches on top
> of sunxi/for-next

Hi,

OrangePi 3 is somewhat different from these two boards (mostly it has a differnt
power tree). It doesn't use the AXP regulators that are defined in the
sun50i-h6-orangepi.dtsi in the same way.

For example:

- bldo3 (is turned always on in sun50i-h6-orangepi.dtsi but unused for opi3)
- cldo2 and cldo3 are unused on opi3 and have nothing to do with WiFi
- aldo3 is not for dram
- bldo1 on the other hand is for dram on opi3
- some other regulators are used for different/more functions and thus
  named differntly
- USB id-det pin is differnt
- ...

OrangePi 3 is not a superset of what is defined in sun50i-h6-orangepi.dtsi.

So to base Orange Pi 3 dts on top of existing sun50i-h6-orangepi.dtsi I'd have
to first move some things out of the base dtsi to the OrangePi Lite2 and One
Plus board dts files, in order to have sun50i-h6-orangepi.dtsi only describe HW
that is *really* shared by these 2 boards and Orange Pi 3.

If I do that, I'd undefine all the axp805 regulator nodes and move the
configurations to each of the 3 board files. That will probably end up being
the least confusing and most maintainable. See axp81x.dtsi lines 86-144 for
what I mean.

What do you think? Is this acceptable to everyone?

regards,
  o.

> https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git/tree/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi?h=sunxi/for-next
> 
> Regards,
> Clement
> 
> >
> > Unfortunately, this board needs some small driver patches, so I have
> > split the boards DT patch into chunks that require patches for drivers
> > in various subsystems:
> >
> > - Basic DT for the board  (patch 1)
> > - HDMI support            (patches 2, 3, 4)
> > - Ethernet support        (patches 5, 6, 7)
> > - WiFi support            (patches 8, 9, 10, 11, 12)
> >
> > This patch is also needed to not get segfault on boot:
> >   https://lkml.org/lkml/2019/4/5/856
> >
> > Please take a look.
> >
> > regards,
> >   Ondrej Jirman
> >
> > Icenowy Zheng (2):
> >   net: stmmac: sun8i: add support for Allwinner H6 EMAC
> >   net: stmmac: sun8i: force select external PHY when no internal one
> >
> > Ondrej Jirman (10):
> >   arm64: dts: allwinner: h6: Add Orange Pi 3 DTS
> >   drm: sun4i: Add support for enabling DDC I2C bus to dw_hdmi glue
> >   dt-bindings: display: sun4i-drm: Add DDC power supply
> >   arm64: dts: allwinner: orange-pi-3: Enable HDMI output
> >   arm64: dts: allwinner: orange-pi-3: Enable ethernet
> >   arm64: dts: allwinner: h6: Add MMC1 pins
> >   pinctrl: sunxi: Prepare for alternative bias voltage setting methods
> >   pinctrl: sunxi: Support I/O bias voltage setting on H6
> >   brcmfmac: Loading the correct firmware for brcm43456
> >   arm64: dts: allwinner: orange-pi-3: Enable WiFi
> >
> >  .../bindings/display/sunxi/sun4i-drm.txt      |   1 +
> >  arch/arm64/boot/dts/allwinner/Makefile        |   1 +
> >  .../dts/allwinner/sun50i-h6-orangepi-3.dts    | 339 ++++++++++++++++++
> >  arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi  |   9 +
> >  drivers/gpu/drm/sun4i/sun8i_dw_hdmi.c         |  17 +-
> >  drivers/gpu/drm/sun4i/sun8i_dw_hdmi.h         |   1 +
> >  .../net/ethernet/stmicro/stmmac/dwmac-sun8i.c |  22 ++
> >  .../broadcom/brcm80211/brcmfmac/sdio.c        |   4 +-
> >  drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c     |   1 +
> >  drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c     |   2 +-
> >  drivers/pinctrl/sunxi/pinctrl-sunxi.c         |  50 ++-
> >  drivers/pinctrl/sunxi/pinctrl-sunxi.h         |   7 +-
> >  12 files changed, 433 insertions(+), 21 deletions(-)
> >  create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
> >
> > --
> > 2.21.0
> >
> > --
> > You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
Ondřej Jirman April 8, 2019, 12:46 p.m. UTC | #2
Hi Jagan,

On Mon, Apr 08, 2019 at 11:31:22AM +0530, Jagan Teki wrote:
> On Sun, Apr 7, 2019 at 8:02 PM 'Ondřej Jirman' via linux-sunxi
> <linux-sunxi@googlegroups.com> wrote:
> >
> > On Sun, Apr 07, 2019 at 03:36:21PM +0200, Clément Péron wrote:
> > > Hi,
> > >
> > > On Sat, 6 Apr 2019 at 01:45, megous via linux-sunxi
> > > <linux-sunxi@googlegroups.com> wrote:
> > > >
> > > > From: Ondrej Jirman <megous@megous.com>
> > > >
> > > > This series implements support for Xunlong Orange Pi 3 board.
> > >
> > > OrangePi 3 Lite2 and One Plus boards support has already been merged.
> > > The support is not complete but you should rebase your patches on top
> > > of sunxi/for-next
> >
> > Hi,
> >
> > OrangePi 3 is somewhat different from these two boards (mostly it has a differnt
> > power tree). It doesn't use the AXP regulators that are defined in the
> > sun50i-h6-orangepi.dtsi in the same way.
> >
> > For example:
> >
> > - bldo3 (is turned always on in sun50i-h6-orangepi.dtsi but unused for opi3)
> > - cldo2 and cldo3 are unused on opi3 and have nothing to do with WiFi
> > - aldo3 is not for dram
> > - bldo1 on the other hand is for dram on opi3
> > - some other regulators are used for different/more functions and thus
> >   named differntly
> > - USB id-det pin is differnt
> > - ...
> 
> Based on my communication with OrangePI, OPI-3 has PCIE, 4 USB-3.0
> ports and AV are the key differences and rest seems to be similar. but
> if we have a diff or unused regulators may be we can't enable them in
> dtsi (I never looked that close as of now)

These regulators are not just disabled on Opi 3, they have different/no meaning.

Schematics allow for high amount of variability in the power tree (see all the
NC (not connected) / 0R resistors) in the schematic around AXP805. Every board
based on this Xunlong design can be subtly different. 

I already suggested a maintainable solution, below. Where base dtsi has empty
config for regulators and every board based on that just defines it completely
for itself.

A few regulators (for CPU/GPU) will most probably have the same meaning on every
derived board, so these can probably be kept in dtsi without causing too much
annoyance.

It's unpleasant to have wrong regulator setup defined in an underlying dtsi, and
then trying to override it by removing/adding random properties in the board dts
for the new boards based on that, so that it fits.

The rest of the current HW descriptions in the sun50i-h6-orangepi.dtsi can be
shared (as of now).

thank you and regards,
  o.