mbox series

[0/3] ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD

Message ID 20210527081646.4813-1-user@home.lan
Headers show
Series ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD | expand

Message

Denis K May 27, 2021, 8:16 a.m. UTC
From: Denis Kalashnikov <denis281089@gmail.com>

RB912 needs two ad hoc drivers: gpio-latch and rb91x_nand. So I've ported them
from ar71xx and added DTS.

In RFC v1 I added a MFD driver that provided API for manipulating shared gpio
lines to gpio-latch and nand drivers. In RFC v2 I just ported gpio-latch and
rb91x_nand drivers from ar71xx to ath79 by adding DTS support and usage of
a new gpio API (gpiod_*). This way is turned to be more clear and compact.
So, I've tried to fix what you guys advised me and here is my patches v1.

All seems to be working on my RB912UAG-2HPnD. Except a button and a beeper. The
beeper seems is not important thing, but the button is. The button shares gpio
15 with NAND ALE and NAND IO7, but this is not easily supported by the current
drivers. May be we need ad hoc driver for button. Or may be there is a more
general solution for this problem (like rb91x-gpio driver that arbitrates
all gpio lines instead of gpio-latch). This can be fixed in the next patches.

Denis Kalashnikov (3):
  ath79: add gpio-latch driver for MikroTik RouterBOARDs
  ath79: add NAND driver for MikroTik RB91xG series
  ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD

 ...9342_mikrotik_routerboard-912uag-2hpnd.dts | 214 ++++++++++
 .../ath79/files/drivers/gpio/gpio-latch.c     | 203 ++++++++++
 .../files/drivers/mtd/nand/raw/rb91x_nand.c   | 375 ++++++++++++++++++
 target/linux/ath79/image/mikrotik.mk          |   9 +
 .../base-files/etc/board.d/02_network         |   2 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom    |   1 +
 .../base-files/lib/upgrade/platform.sh        |   1 +
 target/linux/ath79/mikrotik/config-default    |   1 +
 .../patches-5.10/939-mikrotik-rb91x.patch     |  49 +++
 .../patches-5.4/939-mikrotik-rb91x.patch      |  44 ++
 10 files changed, 899 insertions(+)
 create mode 100644 target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
 create mode 100644 target/linux/ath79/files/drivers/gpio/gpio-latch.c
 create mode 100644 target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
 create mode 100644 target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
 create mode 100644 target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch

Comments

Koen Vandeputte June 14, 2021, 3:29 p.m. UTC | #1
On 27.05.21 10:16, Denis Kalashnikov wrote:
> From: Denis Kalashnikov <denis281089@gmail.com>
>
> RB912 needs two ad hoc drivers: gpio-latch and rb91x_nand. So I've ported them
> from ar71xx and added DTS.
>
> In RFC v1 I added a MFD driver that provided API for manipulating shared gpio
> lines to gpio-latch and nand drivers. In RFC v2 I just ported gpio-latch and
> rb91x_nand drivers from ar71xx to ath79 by adding DTS support and usage of
> a new gpio API (gpiod_*). This way is turned to be more clear and compact.
> So, I've tried to fix what you guys advised me and here is my patches v1.
>
> All seems to be working on my RB912UAG-2HPnD. Except a button and a beeper. The
> beeper seems is not important thing, but the button is. The button shares gpio
> 15 with NAND ALE and NAND IO7, but this is not easily supported by the current
> drivers. May be we need ad hoc driver for button. Or may be there is a more
> general solution for this problem (like rb91x-gpio driver that arbitrates
> all gpio lines instead of gpio-latch). This can be fixed in the next patches.
>
> Denis Kalashnikov (3):
>    ath79: add gpio-latch driver for MikroTik RouterBOARDs
>    ath79: add NAND driver for MikroTik RB91xG series
>    ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD
>
>   ...9342_mikrotik_routerboard-912uag-2hpnd.dts | 214 ++++++++++
>   .../ath79/files/drivers/gpio/gpio-latch.c     | 203 ++++++++++
>   .../files/drivers/mtd/nand/raw/rb91x_nand.c   | 375 ++++++++++++++++++
>   target/linux/ath79/image/mikrotik.mk          |   9 +
>   .../base-files/etc/board.d/02_network         |   2 +
>   .../etc/hotplug.d/firmware/10-ath9k-eeprom    |   1 +
>   .../base-files/lib/upgrade/platform.sh        |   1 +
>   target/linux/ath79/mikrotik/config-default    |   1 +
>   .../patches-5.10/939-mikrotik-rb91x.patch     |  49 +++
>   .../patches-5.4/939-mikrotik-rb91x.patch      |  44 ++
>   10 files changed, 899 insertions(+)
>   create mode 100644 target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
>   create mode 100644 target/linux/ath79/files/drivers/gpio/gpio-latch.c
>   create mode 100644 target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
>   create mode 100644 target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
>   create mode 100644 target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
>
Tested on the 5GHz flavor and works fine


Any other objections/remarks?
I will merge this otherwise tomorrow.

Thanks,

Koen
Sergey Ryazanov June 15, 2021, 1:17 a.m. UTC | #2
On Mon, Jun 14, 2021 at 6:29 PM Koen Vandeputte
<koen.vandeputte@citymesh.com> wrote:
> On 27.05.21 10:16, Denis Kalashnikov wrote:
> > From: Denis Kalashnikov <denis281089@gmail.com>
> >
> > RB912 needs two ad hoc drivers: gpio-latch and rb91x_nand. So I've ported them
> > from ar71xx and added DTS.
> >
> > In RFC v1 I added a MFD driver that provided API for manipulating shared gpio
> > lines to gpio-latch and nand drivers. In RFC v2 I just ported gpio-latch and
> > rb91x_nand drivers from ar71xx to ath79 by adding DTS support and usage of
> > a new gpio API (gpiod_*). This way is turned to be more clear and compact.
> > So, I've tried to fix what you guys advised me and here is my patches v1.
> >
> > All seems to be working on my RB912UAG-2HPnD. Except a button and a beeper. The
> > beeper seems is not important thing, but the button is. The button shares gpio
> > 15 with NAND ALE and NAND IO7, but this is not easily supported by the current
> > drivers. May be we need ad hoc driver for button. Or may be there is a more
> > general solution for this problem (like rb91x-gpio driver that arbitrates
> > all gpio lines instead of gpio-latch). This can be fixed in the next patches.
> >
> > Denis Kalashnikov (3):
> >    ath79: add gpio-latch driver for MikroTik RouterBOARDs
> >    ath79: add NAND driver for MikroTik RB91xG series
> >    ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD
> >
> >   ...9342_mikrotik_routerboard-912uag-2hpnd.dts | 214 ++++++++++
> >   .../ath79/files/drivers/gpio/gpio-latch.c     | 203 ++++++++++
> >   .../files/drivers/mtd/nand/raw/rb91x_nand.c   | 375 ++++++++++++++++++
> >   target/linux/ath79/image/mikrotik.mk          |   9 +
> >   .../base-files/etc/board.d/02_network         |   2 +
> >   .../etc/hotplug.d/firmware/10-ath9k-eeprom    |   1 +
> >   .../base-files/lib/upgrade/platform.sh        |   1 +
> >   target/linux/ath79/mikrotik/config-default    |   1 +
> >   .../patches-5.10/939-mikrotik-rb91x.patch     |  49 +++
> >   .../patches-5.4/939-mikrotik-rb91x.patch      |  44 ++
> >   10 files changed, 899 insertions(+)
> >   create mode 100644 target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
> >   create mode 100644 target/linux/ath79/files/drivers/gpio/gpio-latch.c
> >   create mode 100644 target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
> >   create mode 100644 target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
> >   create mode 100644 target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
> >
> Tested on the 5GHz flavor and works fine
>
>
> Any other objections/remarks?

Still have no chance to run-test it, but the code looks overly good for me.

> I will merge this otherwise tomorrow.

Thanks for taking care of this.

Just curious. Are there any chances that support for this board will
be backported to the 21.02 branch?