Commit Graph

13 Commits

Author SHA1 Message Date
Sander Vanheule fa71139776 realtek: add missing GPIO irq properties
The internal GPIO controller on RTL838x is also an IRQ controller, which
requires the 'interrupt-controller' and '#interrupts-cells' properties
to be present in the device tree.

Reported-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2021-11-28 22:43:08 +01:00
Sander Vanheule 927570f0a3 realtek: Add and enable watchdog node
Add and enable the Realtek Otto WDT peripheral found on these SoCs.

Default all devices to use standard (cold) reboot and "soc" resets.

Devices that require the PLL value fixup before restarting, should pick
the "cpu" or "software" reset mode. These devices also need to provide a
custom reboot mode, by adding the reboot argument to the kernel command
line:

    WDT reset mode  | kernel reboot mode
    ----------------+---------------------------------------
    soc             | reboot=cold (default if not specified)
    cpu             | reboot=warm
    software        | reboot=software

Preferrably, these devices should use an alternative restart method like
gpio-restart to provide reliable restarts.

Note that watchdog restarts are not yet exposed, since the
_machine_restart override is still present.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-11-24 21:43:42 +02:00
Sander Vanheule d3a62bea08 realtek: Add Lexra bus clock
The CPU peripherals on RTL83xx/RTL930x are connected to the CPU via the
Lexra bus. This bus can provide a clock signal to these peripherals, but
no clock driver is currently available. Instead, use a fixed-clock to
provide the clock frequency, and update the dependent peripherals.

Lexra bus clock frequencies:
- RTL838x: 200MHz
- RTL839x: 200MHz
- RTL930x: 175MHz

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-11-24 21:42:56 +02:00
Sander Vanheule af2cfbda2b realtek: Consolidate bootargs
All current devices use identical bootargs, so let's move that to the
common devicetree includes.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tested-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-11-24 21:42:44 +02:00
INAGAKI Hiroshi 216011e424 realtek: enable uart1 on the devices with PoE support in 5.10
On the devices with PoE support, the secondary UART (uart1) on the SoC
is used to communicate between the SoC and controller.

Enable the secondary UART on the following devices:

- D-Link DGS-1210-10P
- Netgear GS110TPP v1
- Netgear GS310TP v1
- ZyXEL GS1900-8HP v1/v2
- ZyXEL GS1900-10HP
- ZyXEL GS1900-24HP v2

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:18 +02:00
INAGAKI Hiroshi 45b2a5d840 realtek: use physical addresses in soc dtsi in 5.10
Use physical addresses instead of virtual address in dts files.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:18 +02:00
INAGAKI Hiroshi d7b349db7c realtek: use gpio-keys instead of "-polled" if SoC GPIO is used in 5.10
The new backported GPIO driver supports interrupt, so use gpio-keys
instead of gpio-keys-polled for keys connected to the internal GPIO
controller.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:18 +02:00
INAGAKI Hiroshi 61a3d0075b realtek: update GPIO bindings in the dts files in dts-5.10
this patch includes the following changes:

- adjust mapping for the new driver
  - GPIO 24 -> GPIO 0
  - GPIO 47 -> GPIO 0 (+ disabling system LED)

- disable pins in the invalid range
  (out of the range 0-31 of the new driver)
  - are these pins on the external RTL8231 (&gpio1)?
    - GPIO 67 (-> GPIO 3 on &gpio1?)
    - GPIO 94 (-> GPIO 30 on &gpio1?)

- drop "indirect-access-bus-id" property from gpio0 node in device dts
  files

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:18 +02:00
INAGAKI Hiroshi 99a658cb71 realtek: add pinmux node of LED_GLB_CTRL to rtl838x.dtsi in dts-5.10
This patch adds a pinctrl-single pinmux node to allow disabling system
LED and enabling GPIO 0 (old driver: GPIO 24).

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:18 +02:00
INAGAKI Hiroshi 3069fffe60 realtek: add "soc" node to soc dtsi in dts-5.10
Add a "soc" node as a simple-bus to rtl838x.dtsi and rtl930x.dtsi.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:17 +02:00
INAGAKI Hiroshi ddaeb73de0 realtek: update soc dtsi in 5.10 for backported drivers
this patch updates SoC dtsi (rtl838x.dtsi, rtl930x.dtsi) for the
following backported drivers:

- gpio-realtek-otto (5.13)
- spi-realtek-rtl (5.12)
- irq-realtek-rtl (5.12)

And, disable SoC GPIO node (gpio0) in rtl930x.dtsi in dts-5.10.
Currently, the upstreamed driver doesn't support the GPIO controller on
RTL930x SoC.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:17 +02:00
INAGAKI Hiroshi 1c020f8b43 realtek: cleanup and update soc dtsi in 5.10
the following changes are included in this patch:

- node is enabled by default, drop 'status = "okay"'
- adjust order of "compatible" lines and "reg" lines
- add a new blank line before fixed-link node in rtl830x.dtsi

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
2021-09-26 00:32:17 +02:00
INAGAKI Hiroshi 0de230bd0c realtek: copy dts directory for Kernel 5.10
This patch adds "dts-5.10" directory to use backported drivers.
There are several specification changes in the new drivers, so there
are some compatibility issues in using dts/dtsi files for 5.4.

The old DTS files are moved to "dts-5.4", so their corresponding
kernel version is obvious as well.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[change "dts" to "dts-5.4", adjust Makefile]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-26 00:32:17 +02:00