Re: [PATCH 1/3] ramips: add support for the RT6855A SoC

2020-12-24 Thread Rafaël Carré

Hello,

Thank you for your comments, they are very much appreciated!

On 12/24/20 04:09, Chuanhong Guo wrote:

Hi!

On Thu, Dec 24, 2020 at 12:51 AM Rafaël Carré  wrote:


Add Linksys WAP300N target



+ethernet: ethernet@5{
+compatible = "ralink,rt6855-eth";


This doesn't match your compatible string choice in the ethernet driver.


Indeed.

As I said in an earlier mail, I did not find yet how the OpenWrt .dts 
takes precedence over the in-tree one.


All the needed declarations are in the in-tree .dts, including 
OpenWrt-specific ones.


I will look at this before sending another patch.



diff --git a/target/linux/ramips/dts/rt6855a_linksys_wap300n.dts 
b/target/linux/ramips/dts/rt6855a_linksys_wap300n.dts
new file mode 100644
index 00..d923946c4a
--- /dev/null
+++ b/target/linux/ramips/dts/rt6855a_linksys_wap300n.dts
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+/include/ "rt6855.dtsi"
+
+/ {
+   compatible = "ralink,rt6855-soc";
+   model = "Linksys WAP300n";
+
+   memory@0 {
+   device_type = "memory";
+   reg = <0x2 0x3fe>;
+   };
+
+   chosen {
+   bootargs = "console=ttyS0,57600";
+   };
+};


Seems incomplete?


It's quite possible some things need to move from rt6855a.dtsi into this 
file. Will look at this as well.


___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


Re: [PATCH 1/3] ramips: add support for the RT6855A SoC

2020-12-23 Thread Chuanhong Guo
Hi!

On Thu, Dec 24, 2020 at 12:51 AM Rafaël Carré  wrote:
>
> Add Linksys WAP300N target

Please separate device support from target addition, and check
your device support against our wiki checklist:
https://openwrt.org/docs/guide-developer/device-support-policies

>
> Signed-off-by: Rafaël Carré 
> ---
>  target/linux/ramips/Makefile  |2 +-
>  target/linux/ramips/dts/rt6855.dtsi   |   93 +
>  .../ramips/dts/rt6855a_linksys_wap300n.dts|   18 +
>  target/linux/ramips/image/Makefile|1 +
>  target/linux/ramips/image/rt6855a.mk  |   15 +
>  .../rt6855a/base-files/etc/board.d/01_leds|   12 +
>  .../rt6855a/base-files/etc/board.d/02_network |   11 +
>  .../base-files/etc/board.d/03_gpio_switches   |   11 +
>  target/linux/ramips/rt6855a/config-5.4| 2266 +
>  .../ramips/rt6855a/profiles/00-default.mk |   17 +
>  target/linux/ramips/rt6855a/target.mk |   15 +
>  11 files changed, 2460 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/ramips/dts/rt6855.dtsi
>  create mode 100644 target/linux/ramips/dts/rt6855a_linksys_wap300n.dts
>  create mode 100644 target/linux/ramips/image/rt6855a.mk
>  create mode 100755 target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
>  create mode 100755 
> target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
>  create mode 100755 
> target/linux/ramips/rt6855a/base-files/etc/board.d/03_gpio_switches
>  create mode 100644 target/linux/ramips/rt6855a/config-5.4
>  create mode 100644 target/linux/ramips/rt6855a/profiles/00-default.mk
>  create mode 100644 target/linux/ramips/rt6855a/target.mk
>
> diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
> index c3d118b2ab..f03118c1aa 100644
> --- a/target/linux/ramips/Makefile
> +++ b/target/linux/ramips/Makefile
> @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
>  ARCH:=mipsel
>  BOARD:=ramips
>  BOARDNAME:=MediaTek Ralink MIPS
> -SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883
> +SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883 rt6855a
>  FEATURES:=squashfs gpio
>
>  KERNEL_PATCHVER:=5.4
> diff --git a/target/linux/ramips/dts/rt6855.dtsi 
> b/target/linux/ramips/dts/rt6855.dtsi
> new file mode 100644
> index 00..4ff9460256
> --- /dev/null
> +++ b/target/linux/ramips/dts/rt6855.dtsi
> @@ -0,0 +1,93 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/ {
> +   #address-cells = <1>;
> +   #size-cells = <1>;
> +   compatible = "ralink,rt6855-soc";
> +
> +   cpus {
> +   cpu@0 {
> +   compatible = "mips,mips34Kc";
> +   };
> +   };
> +
> +   cpuintc: cpuintc {
> +   #address-cells = <0>;
> +   #interrupt-cells = <1>;
> +   interrupt-controller;
> +   compatible = "mti,cpu-interrupt-controller";
> +   };
> +
> +   palmbus@1fb0 {
> +   compatible = "palmbus";
> +   reg = <0x1fb0 0xe>;
> +   ranges = <0x0 0x1fb0 0x10>;
> +
> +   #address-cells = <1>;
> +   #size-cells = <1>;
> +
> +   sysc@0 {
> +   compatible = "ralink,rt6855-sysc";
> +   reg = <0x0 0x100>;
> +   };
> +
> +   intc: intc@4 {
> +   compatible = "ralink,rt6855-intc";
> +   reg = <0x4 0x100>;
> +
> +   interrupt-controller;
> +   #interrupt-cells = <1>;
> +
> +   interrupt-parent = <>;
> +   };
> +
> +   memc@300 {
> +   compatible = "ralink,rt6855-memc", 
> "ralink,rt3050-memc";
> +   reg = <0x300 0x100>;
> +   };
> +
> +   watchdog@f0100 {
> +   compatible = "ralink,rt6855-wdt";
> +   reg = <0xf0100 0x10>;
> +   };
> +
> +   uart: uart@f {
> +   compatible = "ns8250";
> +   reg = <0xf 0x30>;
> +   interrupts = <0>;
> +
> +   clock-frequency = <921600>;
> +
> +   reg-io-width = <4>;
> +   reg-shift = <2>;
> +   no-loopback-test;
> +
> +   status = "okay";
> +
> +   interrupt-parent = <>;
> +   };
> +
> +   gdma: gdma@3 {
> +   compatible = "ralink,gdma-rt2880";
> +   reg = <0x3 0x100>;
> +   };
> +
> +ethernet: ethernet@5{
> +compatible = "ralink,rt6855-eth";

This doesn't match your compatible string choice in the ethernet driver.

> +reg = <0x5 0x1>;
> +
> +interrupt-parent = <>;
> +interrupts = <21>;
> +
> +mediatek,switch = <>;
> +};
> +
> +