diff mbox series

[RFC,v2,1/3] ramips: add support for the RT6855A SoC

Message ID 20201228002438.414861-2-funman@videolan.org
State Not Applicable, archived
Delegated to: Chuanhong Guo
Headers show
Series [RFC,v2,1/3] ramips: add support for the RT6855A SoC | expand

Commit Message

Rafaël Carré Dec. 28, 2020, 12:24 a.m. UTC
Add Linksys WAP300N target

Signed-off-by: Rafaël Carré <funman@videolan.org>
---
Changes since v1:
- Use OpenWrt .dts (CONFIG_MIPS_RAW_APPENDED_DTB)
- clean up rt6855a.mk
- add case/esac in /etc/board.d/*
- tidy up config-5.4

 target/linux/ramips/Makefile                  |   2 +-
 target/linux/ramips/dts/rt6855a.dtsi          | 190 ++++++++++
 .../ramips/dts/rt6855a_linksys_wap300n.dts    |  22 ++
 target/linux/ramips/image/Makefile            |   1 +
 target/linux/ramips/image/rt6855a.mk          |  12 +
 .../rt6855a/base-files/etc/board.d/01_leds    |  17 +
 .../rt6855a/base-files/etc/board.d/02_network |  17 +
 .../base-files/etc/board.d/03_gpio_switches   |  16 +
 target/linux/ramips/rt6855a/config-5.4        | 344 ++++++++++++++++++
 .../ramips/rt6855a/profiles/00-default.mk     |  17 +
 target/linux/ramips/rt6855a/target.mk         |  15 +
 11 files changed, 652 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/ramips/dts/rt6855a.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

Comments

Adrian Schmutzler Dec. 28, 2020, 1:16 p.m. UTC | #1
Hi,

some additional (general) remarks below.

> -----Original Message-----
> From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> On Behalf Of Rafaël Carré
> Sent: Montag, 28. Dezember 2020 01:25
> To: openwrt-devel@lists.openwrt.org
> Cc: Rafaël Carré <funman@videolan.org>
> Subject: [RFC PATCH v2 1/3] ramips: add support for the RT6855A SoC
> 
> Add Linksys WAP300N target
> 
> Signed-off-by: Rafaël Carré <funman@videolan.org>
> ---
> Changes since v1:
> - Use OpenWrt .dts (CONFIG_MIPS_RAW_APPENDED_DTB)
> - clean up rt6855a.mk
> - add case/esac in /etc/board.d/*
> - tidy up config-5.4
> 
>  target/linux/ramips/Makefile                  |   2 +-
>  target/linux/ramips/dts/rt6855a.dtsi          | 190 ++++++++++
>  .../ramips/dts/rt6855a_linksys_wap300n.dts    |  22 ++
>  target/linux/ramips/image/Makefile            |   1 +
>  target/linux/ramips/image/rt6855a.mk          |  12 +
>  .../rt6855a/base-files/etc/board.d/01_leds    |  17 +
>  .../rt6855a/base-files/etc/board.d/02_network |  17 +
>  .../base-files/etc/board.d/03_gpio_switches   |  16 +
>  target/linux/ramips/rt6855a/config-5.4        | 344 ++++++++++++++++++
>  .../ramips/rt6855a/profiles/00-default.mk     |  17 +
>  target/linux/ramips/rt6855a/target.mk         |  15 +
>  11 files changed, 652 insertions(+), 1 deletion(-)  create mode 100644
> target/linux/ramips/dts/rt6855a.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/rt6855a.dtsi
> b/target/linux/ramips/dts/rt6855a.dtsi
> new file mode 100644
> index 0000000000..76cd3da568
> --- /dev/null
> +++ b/target/linux/ramips/dts/rt6855a.dtsi
> @@ -0,0 +1,190 @@
> +// SPDX-License-Identifier: GPL-2.0

Please add /dts-v1/; here, with empty line before and after.

> +/ {
> +	#address-cells = <1>;
> +	#size-cells = <1>;
> +	compatible = "ralink,rt6855a-soc";
> +
> +	cpus {
> +		cpu@0 {
> +			compatible = "mips,mips34Kc";
> +		};
> +	};
> +
> +	cpuintc: cpuintc {
> +		#address-cells = <0>;
> +		#interrupt-cells = <1>;
> +		interrupt-controller;
> +		compatible = "mti,cpu-interrupt-controller";
> +	};
> +
> +	palmbus@1fb00000 {
> +		compatible = "palmbus";
> +		reg = <0x1fb00000 0xe0000>;
> +		ranges = <0x0 0x1fb00000 0x100000>;
> +
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +
> +		sysc@800 {
> +			compatible = "ralink,rt6855a-sysc";
> +			reg = <0x800 0x100>;
> +		};
> +
> +		intc: intc@40000 {
> +			compatible = "ralink,rt6855a-intc";
> +			reg = <0x40000 0x100>;
> +
> +			interrupt-controller;
> +			#interrupt-cells = <1>;
> +
> +			interrupt-parent = <&cpuintc>;
> +		};
> +
> +		memc@300 {
> +			compatible = "ralink,rt6855a-memc", "ralink,rt3050-
> memc";
> +			reg = <0x300 0x100>;
> +		};
> +
> +		watchdog@f0100 {
> +			compatible = "ralink,rt6855a-wdt";
> +			reg = <0xf0100 0x10>;
> +		};
> +
> +		uart: uart@f0000 {
> +			compatible = "ns8250";
> +			reg = <0xf0000 0x30>;
> +			interrupts = <0>;
> +
> +			clock-frequency = <921600>;
> +
> +			reg-io-width = <4>;
> +			reg-shift = <2>;
> +			no-loopback-test;
> +
> +			status = "okay";
> +
> +			interrupt-parent = <&intc>;
> +		};
> +
> +		gdma: gdma@30000 {
> +			compatible = "ralink,gdma-rt2880";
> +			reg = <0x30000 0x100>;
> +		};
> +
> +        ethernet: ethernet@50000{
> +            compatible = "ralink,rt6855a-eth";
> +            reg = <0x50000 0x10000>;
> +
> +            interrupt-parent = <&intc>;
> +            interrupts = <21>;
> +
> +            mediatek,switch = <&esw>;
> +            mtd-mac-address = <&factory 0xe000>;
> +        };

Please make sure indent is all tabs.

> +
> +        esw: esw@60000 {
> +            compatible = "ralink,rt3050-esw";
> +            reg = <0x60000 0x8000>;
> +
> +            interrupt-parent = <&intc>;
> +            interrupts = <15>;
> +        };
> +
> +        spi0: spi@c0b00 {
> +            status = "disabled";
> +
> +            compatible = "ralink,mt7621-spi";
> +            reg = <0xc0b00 0x100>;
> +
> +            //clocks = <&pll MT7621_CLK_BUS>;
> +
> +            //resets = <&rstctrl 18>;
> +            //reset-names = "spi";
> +
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            //pinctrl-names = "default";
> +            //pinctrl-0 = <&spi_pins>;
> +        };
> +    };
> +
> +    pcie: pcie@1fb80000 {
> +        compatible = "ralink,rt3883-pci";
> +        reg = <0x1fb80000 0x20000>;
> +        #address-cells = <3>;
> +        #size-cells = <2>;
> +
> +        #interrupt-cells = <1>;
> +
> +        device_type = "pci";
> +        interrupt-map-mask = <0x0 0 0 0>;
> +        interrupt-map = <0x0 0 0 0 &pciintc 20>;
> +
> +        ranges = <
> +            0x02000000 0 0x20000000 0x20000000 0 0x10000000 /* pci memory */
> +            0x01000000 0 0x1f600000 0x1f600000 0 0x00010000 /* io space */
> +        >;
> +
> +        bus-range = <0 255>;
> +        status = "disabled";
> +
> +        pciintc: interrupt-controller {
> +            interrupt-controller;
> +            #address-cells = <0>;
> +            #interrupt-cells = <1>;
> +
> +            interrupt-parent = <&intc>;
> +            interrupts = <24>;
> +        };
> +
> +    };
> +

Remove useless empty lines between closing brackets.

> +};
> +
> +&spi0 {
> +    status = "okay";
> +
> +    flash@0 {
> +        compatible = "jedec,spi-nor";
> +        reg = <0>;
> +        spi-max-frequency = <10000000>;
> +
> +        partitions {
> +            compatible = "fixed-partitions";
> +            #address-cells = <1>;
> +            #size-cells = <1>;
> +
> +            partition@0 {
> +                label = "Bootloader";
> +                reg = <0x0 0x30000>;
> +                read-only;
> +            };
> +
> +            partition@30000 {
> +                label = "Config";
> +                reg = <0x30000 0x10000>;
> +                read-only;
> +            };
> +
> +            factory: partition@40000 {
> +                label = "Factory";
> +                reg = <0x40000 0x10000>;
> +                read-only;
> +            };
> +
> +            partition@50000 {
> +                compatible = "denx,uimage";
> +                label = "Kernel";
> +                reg = <0x50000 0x7b0000>;
> +            };
> +        };

I don't think a partitioning should be located in the SoC DTSI.

> +    };
> +};
> +
> +&pcie {
> +    wifi@0,0 {
> +        compatible = "pci1814,3091";
> +        ralink,mtd-eeprom = <&factory 0x8000>;
> +    };

Same here, depends on partitioning.

> +};
> 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 0000000000..4b502ec0a7
> --- /dev/null
> +++ b/target/linux/ramips/dts/rt6855a_linksys_wap300n.dts
> @@ -0,0 +1,22 @@
> +// SPDX-License-Identifier: GPL-2.0

There is no GPL-2.0, either GPL-2.0-only or GPL-2.0-or-later

> +/dts-v1/;

Drop dts-v1 here, we'll have that in DTSI.

> +
> +/include/ "rt6855a.dtsi"

We typically use #include here.

> +
> +/ {
> +	compatible = "ralink,rt6855a-soc";

Device compatible is missing.

> +	model = "Linksys foobar WAP300n";

Use proper name.

> +
> +	memory@0 {
> +		device_type = "memory";
> +		reg = <0x20000 0x3fe0000>;
> +	};

Do we need this, on other ramips platforms memory is auto-detected?

> +
> +	chosen {
> +		bootargs = "console=ttyS0,57600";
> +	};
> +
> +	pcie@1fb80000 {
> +		status = "okay";
> +	};

Use a DT label instead.

> +};
> diff --git a/target/linux/ramips/image/Makefile
> b/target/linux/ramips/image/Makefile
> index 4274c24884..8c916c072b 100644
> --- a/target/linux/ramips/image/Makefile
> +++ b/target/linux/ramips/image/Makefile
> @@ -17,6 +17,7 @@ DEVICE_VARS += SERCOMM_PAD JCG_MAXSIZE
> loadaddr-y := 0x80000000
>  loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
>  loadaddr-$(CONFIG_TARGET_ramips_mt7621) := 0x80001000
> +loadaddr-$(CONFIG_TARGET_ramips_rt6855a) := 0x80020000
> 
>  ldrplatform-y := ralink
>  ldrplatform-$(CONFIG_TARGET_ramips_mt7621) := mt7621 diff --git
> a/target/linux/ramips/image/rt6855a.mk
> b/target/linux/ramips/image/rt6855a.mk
> new file mode 100644
> index 0000000000..678f12eb65
> --- /dev/null
> +++ b/target/linux/ramips/image/rt6855a.mk
> @@ -0,0 +1,12 @@
> +#
> +# RT6855A Profiles
> +#
> +
> +define Device/linksys_wap300n
> +  SOC := rt6855a
> +  IMAGE_SIZE := 7936k
> +  DEVICE_VENDOR := Linksys
> +  DEVICE_MODEL := WAP300N
> +  DEVICE_PACKAGES:= kmod-rt2800-pci
> +endef
> +TARGET_DEVICES += linksys_wap300n
> diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
> b/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
> new file mode 100755
> index 0000000000..575a36cf40
> --- /dev/null
> +++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +
> +. /lib/functions/leds.sh
> +. /lib/functions/uci-defaults.sh
> +
> +board=$(board_name)
> +
> +board_config_update
> +
> +case $board in
> +linksys,wap300n)
> +	;;

If we don't need the file, I don't see a reason to create a dummy now.

> +esac
> +
> +board_config_flush
> +
> +exit 0
> diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
> b/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
> new file mode 100755
> index 0000000000..84753ce846
> --- /dev/null
> +++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
> @@ -0,0 +1,17 @@
> +#!/bin/sh
> +
> +. /lib/functions.sh
> +. /lib/functions/uci-defaults.sh
> +. /lib/functions/system.sh

You don't need all of these, do you?

> +
> +board_config_update
> +
> +case $board in

This is broken copy-paste, $board is never assigned.

> +linksys,wap300n)
> +	ucidef_set_interface_lan "eth0"
> +	;;
> +esac
> +
> +board_config_flush
> +
> +exit 0
> diff --git a/target/linux/ramips/rt6855a/base-
> files/etc/board.d/03_gpio_switches b/target/linux/ramips/rt6855a/base-
> files/etc/board.d/03_gpio_switches
> new file mode 100755
> index 0000000000..51f7e2dee7
> --- /dev/null
> +++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/03_gpio_switche
> +++ s
> @@ -0,0 +1,16 @@
> +#!/bin/sh
> +
> +. /lib/functions/uci-defaults.sh
> +
> +board=$(board_name)
> +
> +board_config_update
> +
> +case $board in
> +linksys,wap300n)
> +	;;

Again, no need for useless file.

Best

Adrian
Daniel Golle Dec. 28, 2020, 1:28 p.m. UTC | #2
On Mon, Dec 28, 2020 at 02:16:29PM +0100, Adrian Schmutzler wrote:
> Hi,
> 
> some additional (general) remarks below.
> 
> > -----Original Message-----
> > From: openwrt-devel [mailto:openwrt-devel-bounces@lists.openwrt.org]
> > On Behalf Of Rafaël Carré
> > Sent: Montag, 28. Dezember 2020 01:25
> > To: openwrt-devel@lists.openwrt.org
> > Cc: Rafaël Carré <funman@videolan.org>
> > Subject: [RFC PATCH v2 1/3] ramips: add support for the RT6855A SoC
> > 
> > Add Linksys WAP300N target
> > 
> > Signed-off-by: Rafaël Carré <funman@videolan.org>
> > ---
> > Changes since v1:
> > - Use OpenWrt .dts (CONFIG_MIPS_RAW_APPENDED_DTB)
> > - clean up rt6855a.mk
> > - add case/esac in /etc/board.d/*
> > - tidy up config-5.4
> > 
> >  target/linux/ramips/Makefile                  |   2 +-
> >  target/linux/ramips/dts/rt6855a.dtsi          | 190 ++++++++++
> >  .../ramips/dts/rt6855a_linksys_wap300n.dts    |  22 ++
> >  target/linux/ramips/image/Makefile            |   1 +
> >  target/linux/ramips/image/rt6855a.mk          |  12 +
> >  .../rt6855a/base-files/etc/board.d/01_leds    |  17 +
> >  .../rt6855a/base-files/etc/board.d/02_network |  17 +
> >  .../base-files/etc/board.d/03_gpio_switches   |  16 +
> >  target/linux/ramips/rt6855a/config-5.4        | 344 ++++++++++++++++++
> >  .../ramips/rt6855a/profiles/00-default.mk     |  17 +
> >  target/linux/ramips/rt6855a/target.mk         |  15 +
> >  11 files changed, 652 insertions(+), 1 deletion(-)  create mode 100644
> > target/linux/ramips/dts/rt6855a.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/rt6855a.dtsi
> > b/target/linux/ramips/dts/rt6855a.dtsi
> > new file mode 100644
> > index 0000000000..76cd3da568
> > --- /dev/null
> > +++ b/target/linux/ramips/dts/rt6855a.dtsi
> > @@ -0,0 +1,190 @@
> > +// SPDX-License-Identifier: GPL-2.0
> 
> Please add /dts-v1/; here, with empty line before and after.
> 
> > +/ {
> > +	#address-cells = <1>;
> > +	#size-cells = <1>;
> > +	compatible = "ralink,rt6855a-soc";
> > +
> > +	cpus {
> > +		cpu@0 {
> > +			compatible = "mips,mips34Kc";
> > +		};
> > +	};
> > +
> > +	cpuintc: cpuintc {
> > +		#address-cells = <0>;
> > +		#interrupt-cells = <1>;
> > +		interrupt-controller;
> > +		compatible = "mti,cpu-interrupt-controller";
> > +	};
> > +
> > +	palmbus@1fb00000 {
> > +		compatible = "palmbus";
> > +		reg = <0x1fb00000 0xe0000>;
> > +		ranges = <0x0 0x1fb00000 0x100000>;
> > +
> > +		#address-cells = <1>;
> > +		#size-cells = <1>;
> > +
> > +		sysc@800 {
> > +			compatible = "ralink,rt6855a-sysc";
> > +			reg = <0x800 0x100>;
> > +		};
> > +
> > +		intc: intc@40000 {
> > +			compatible = "ralink,rt6855a-intc";
> > +			reg = <0x40000 0x100>;
> > +
> > +			interrupt-controller;
> > +			#interrupt-cells = <1>;
> > +
> > +			interrupt-parent = <&cpuintc>;
> > +		};
> > +
> > +		memc@300 {
> > +			compatible = "ralink,rt6855a-memc", "ralink,rt3050-
> > memc";
> > +			reg = <0x300 0x100>;
> > +		};
> > +
> > +		watchdog@f0100 {
> > +			compatible = "ralink,rt6855a-wdt";
> > +			reg = <0xf0100 0x10>;
> > +		};
> > +
> > +		uart: uart@f0000 {
> > +			compatible = "ns8250";
> > +			reg = <0xf0000 0x30>;
> > +			interrupts = <0>;
> > +
> > +			clock-frequency = <921600>;
> > +
> > +			reg-io-width = <4>;
> > +			reg-shift = <2>;
> > +			no-loopback-test;
> > +
> > +			status = "okay";
> > +
> > +			interrupt-parent = <&intc>;
> > +		};
> > +
> > +		gdma: gdma@30000 {
> > +			compatible = "ralink,gdma-rt2880";
> > +			reg = <0x30000 0x100>;
> > +		};
> > +
> > +        ethernet: ethernet@50000{
> > +            compatible = "ralink,rt6855a-eth";
> > +            reg = <0x50000 0x10000>;
> > +
> > +            interrupt-parent = <&intc>;
> > +            interrupts = <21>;
> > +
> > +            mediatek,switch = <&esw>;
> > +            mtd-mac-address = <&factory 0xe000>;
> > +        };
> 
> Please make sure indent is all tabs.
> 
> > +
> > +        esw: esw@60000 {
> > +            compatible = "ralink,rt3050-esw";
> > +            reg = <0x60000 0x8000>;
> > +
> > +            interrupt-parent = <&intc>;
> > +            interrupts = <15>;
> > +        };
> > +
> > +        spi0: spi@c0b00 {
> > +            status = "disabled";
> > +
> > +            compatible = "ralink,mt7621-spi";
> > +            reg = <0xc0b00 0x100>;
> > +
> > +            //clocks = <&pll MT7621_CLK_BUS>;
> > +
> > +            //resets = <&rstctrl 18>;
> > +            //reset-names = "spi";
> > +
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            //pinctrl-names = "default";
> > +            //pinctrl-0 = <&spi_pins>;
> > +        };
> > +    };
> > +
> > +    pcie: pcie@1fb80000 {
> > +        compatible = "ralink,rt3883-pci";
> > +        reg = <0x1fb80000 0x20000>;
> > +        #address-cells = <3>;
> > +        #size-cells = <2>;
> > +
> > +        #interrupt-cells = <1>;
> > +
> > +        device_type = "pci";
> > +        interrupt-map-mask = <0x0 0 0 0>;
> > +        interrupt-map = <0x0 0 0 0 &pciintc 20>;
> > +
> > +        ranges = <
> > +            0x02000000 0 0x20000000 0x20000000 0 0x10000000 /* pci memory */
> > +            0x01000000 0 0x1f600000 0x1f600000 0 0x00010000 /* io space */
> > +        >;
> > +
> > +        bus-range = <0 255>;
> > +        status = "disabled";
> > +
> > +        pciintc: interrupt-controller {
> > +            interrupt-controller;
> > +            #address-cells = <0>;
> > +            #interrupt-cells = <1>;
> > +
> > +            interrupt-parent = <&intc>;
> > +            interrupts = <24>;
> > +        };
> > +
> > +    };
> > +
> 
> Remove useless empty lines between closing brackets.
> 
> > +};
> > +
> > +&spi0 {
> > +    status = "okay";
> > +
> > +    flash@0 {
> > +        compatible = "jedec,spi-nor";
> > +        reg = <0>;
> > +        spi-max-frequency = <10000000>;
> > +
> > +        partitions {
> > +            compatible = "fixed-partitions";
> > +            #address-cells = <1>;
> > +            #size-cells = <1>;
> > +
> > +            partition@0 {
> > +                label = "Bootloader";
> > +                reg = <0x0 0x30000>;
> > +                read-only;
> > +            };
> > +
> > +            partition@30000 {
> > +                label = "Config";
> > +                reg = <0x30000 0x10000>;
> > +                read-only;
> > +            };
> > +
> > +            factory: partition@40000 {
> > +                label = "Factory";
> > +                reg = <0x40000 0x10000>;
> > +                read-only;
> > +            };
> > +
> > +            partition@50000 {
> > +                compatible = "denx,uimage";
> > +                label = "Kernel";
> > +                reg = <0x50000 0x7b0000>;
> > +            };
> > +        };
> 
> I don't think a partitioning should be located in the SoC DTSI.

In case of Ralink SoCs I would see that as legitimate as truely a very
large number of devices usually uses that (reference) partitioning.

> 
> > +    };
> > +};
> > +
> > +&pcie {
> > +    wifi@0,0 {
> > +        compatible = "pci1814,3091";
> > +        ralink,mtd-eeprom = <&factory 0x8000>;
> > +    };
> 
> Same here, depends on partitioning.

The whole &pcie { ... } section should indeed go into the device DTS.

> 
> > +};
> > 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 0000000000..4b502ec0a7
> > --- /dev/null
> > +++ b/target/linux/ramips/dts/rt6855a_linksys_wap300n.dts
> > @@ -0,0 +1,22 @@
> > +// SPDX-License-Identifier: GPL-2.0
> 
> There is no GPL-2.0, either GPL-2.0-only or GPL-2.0-or-later
> 
> > +/dts-v1/;
> 
> Drop dts-v1 here, we'll have that in DTSI.
> 
> > +
> > +/include/ "rt6855a.dtsi"
> 
> We typically use #include here.
> 
> > +
> > +/ {
> > +	compatible = "ralink,rt6855a-soc";
> 
> Device compatible is missing.
> 
> > +	model = "Linksys foobar WAP300n";
> 
> Use proper name.
> 
> > +
> > +	memory@0 {
> > +		device_type = "memory";
> > +		reg = <0x20000 0x3fe0000>;
> > +	};
> 
> Do we need this, on other ramips platforms memory is auto-detected?
> 
> > +
> > +	chosen {
> > +		bootargs = "console=ttyS0,57600";
> > +	};
> > +
> > +	pcie@1fb80000 {
> > +		status = "okay";
> > +	};
> 
> Use a DT label instead.

... and add the EEPROM information here as well instead of having it
in the SoC's DTSI.


> 
> > +};
> > diff --git a/target/linux/ramips/image/Makefile
> > b/target/linux/ramips/image/Makefile
> > index 4274c24884..8c916c072b 100644
> > --- a/target/linux/ramips/image/Makefile
> > +++ b/target/linux/ramips/image/Makefile
> > @@ -17,6 +17,7 @@ DEVICE_VARS += SERCOMM_PAD JCG_MAXSIZE
> > loadaddr-y := 0x80000000
> >  loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
> >  loadaddr-$(CONFIG_TARGET_ramips_mt7621) := 0x80001000
> > +loadaddr-$(CONFIG_TARGET_ramips_rt6855a) := 0x80020000
> > 
> >  ldrplatform-y := ralink
> >  ldrplatform-$(CONFIG_TARGET_ramips_mt7621) := mt7621 diff --git
> > a/target/linux/ramips/image/rt6855a.mk
> > b/target/linux/ramips/image/rt6855a.mk
> > new file mode 100644
> > index 0000000000..678f12eb65
> > --- /dev/null
> > +++ b/target/linux/ramips/image/rt6855a.mk
> > @@ -0,0 +1,12 @@
> > +#
> > +# RT6855A Profiles
> > +#
> > +
> > +define Device/linksys_wap300n
> > +  SOC := rt6855a
> > +  IMAGE_SIZE := 7936k
> > +  DEVICE_VENDOR := Linksys
> > +  DEVICE_MODEL := WAP300N
> > +  DEVICE_PACKAGES:= kmod-rt2800-pci
> > +endef
> > +TARGET_DEVICES += linksys_wap300n
> > diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
> > b/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
> > new file mode 100755
> > index 0000000000..575a36cf40
> > --- /dev/null
> > +++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
> > @@ -0,0 +1,17 @@
> > +#!/bin/sh
> > +
> > +. /lib/functions/leds.sh
> > +. /lib/functions/uci-defaults.sh
> > +
> > +board=$(board_name)
> > +
> > +board_config_update
> > +
> > +case $board in
> > +linksys,wap300n)
> > +	;;
> 
> If we don't need the file, I don't see a reason to create a dummy now.
> 
> > +esac
> > +
> > +board_config_flush
> > +
> > +exit 0
> > diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
> > b/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
> > new file mode 100755
> > index 0000000000..84753ce846
> > --- /dev/null
> > +++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
> > @@ -0,0 +1,17 @@
> > +#!/bin/sh
> > +
> > +. /lib/functions.sh
> > +. /lib/functions/uci-defaults.sh
> > +. /lib/functions/system.sh
> 
> You don't need all of these, do you?
> 
> > +
> > +board_config_update
> > +
> > +case $board in
> 
> This is broken copy-paste, $board is never assigned.
> 
> > +linksys,wap300n)
> > +	ucidef_set_interface_lan "eth0"
> > +	;;
> > +esac
> > +
> > +board_config_flush
> > +
> > +exit 0
> > diff --git a/target/linux/ramips/rt6855a/base-
> > files/etc/board.d/03_gpio_switches b/target/linux/ramips/rt6855a/base-
> > files/etc/board.d/03_gpio_switches
> > new file mode 100755
> > index 0000000000..51f7e2dee7
> > --- /dev/null
> > +++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/03_gpio_switche
> > +++ s
> > @@ -0,0 +1,16 @@
> > +#!/bin/sh
> > +
> > +. /lib/functions/uci-defaults.sh
> > +
> > +board=$(board_name)
> > +
> > +board_config_update
> > +
> > +case $board in
> > +linksys,wap300n)
> > +	;;
> 
> Again, no need for useless file.
> 
> Best
> 
> Adrian 



> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

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/rt6855a.dtsi b/target/linux/ramips/dts/rt6855a.dtsi
new file mode 100644
index 0000000000..76cd3da568
--- /dev/null
+++ b/target/linux/ramips/dts/rt6855a.dtsi
@@ -0,0 +1,190 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "ralink,rt6855a-soc";
+
+	cpus {
+		cpu@0 {
+			compatible = "mips,mips34Kc";
+		};
+	};
+
+	cpuintc: cpuintc {
+		#address-cells = <0>;
+		#interrupt-cells = <1>;
+		interrupt-controller;
+		compatible = "mti,cpu-interrupt-controller";
+	};
+
+	palmbus@1fb00000 {
+		compatible = "palmbus";
+		reg = <0x1fb00000 0xe0000>;
+		ranges = <0x0 0x1fb00000 0x100000>;
+
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		sysc@800 {
+			compatible = "ralink,rt6855a-sysc";
+			reg = <0x800 0x100>;
+		};
+
+		intc: intc@40000 {
+			compatible = "ralink,rt6855a-intc";
+			reg = <0x40000 0x100>;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&cpuintc>;
+		};
+
+		memc@300 {
+			compatible = "ralink,rt6855a-memc", "ralink,rt3050-memc";
+			reg = <0x300 0x100>;
+		};
+
+		watchdog@f0100 {
+			compatible = "ralink,rt6855a-wdt";
+			reg = <0xf0100 0x10>;
+		};
+
+		uart: uart@f0000 {
+			compatible = "ns8250";
+			reg = <0xf0000 0x30>;
+			interrupts = <0>;
+
+			clock-frequency = <921600>;
+
+			reg-io-width = <4>;
+			reg-shift = <2>;
+			no-loopback-test;
+
+			status = "okay";
+
+			interrupt-parent = <&intc>;
+		};
+
+		gdma: gdma@30000 {
+			compatible = "ralink,gdma-rt2880";
+			reg = <0x30000 0x100>;
+		};
+
+        ethernet: ethernet@50000{
+            compatible = "ralink,rt6855a-eth";
+            reg = <0x50000 0x10000>;
+
+            interrupt-parent = <&intc>;
+            interrupts = <21>;
+
+            mediatek,switch = <&esw>;
+            mtd-mac-address = <&factory 0xe000>;
+        };
+
+        esw: esw@60000 {
+            compatible = "ralink,rt3050-esw";
+            reg = <0x60000 0x8000>;
+
+            interrupt-parent = <&intc>;
+            interrupts = <15>;
+        };
+
+        spi0: spi@c0b00 {
+            status = "disabled";
+
+            compatible = "ralink,mt7621-spi";
+            reg = <0xc0b00 0x100>;
+
+            //clocks = <&pll MT7621_CLK_BUS>;
+
+            //resets = <&rstctrl 18>;
+            //reset-names = "spi";
+
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            //pinctrl-names = "default";
+            //pinctrl-0 = <&spi_pins>;
+        };
+    };
+
+    pcie: pcie@1fb80000 {
+        compatible = "ralink,rt3883-pci";
+        reg = <0x1fb80000 0x20000>;
+        #address-cells = <3>;
+        #size-cells = <2>;
+
+        #interrupt-cells = <1>;
+
+        device_type = "pci";
+        interrupt-map-mask = <0x0 0 0 0>;
+        interrupt-map = <0x0 0 0 0 &pciintc 20>;
+
+        ranges = <
+            0x02000000 0 0x20000000 0x20000000 0 0x10000000 /* pci memory */
+            0x01000000 0 0x1f600000 0x1f600000 0 0x00010000 /* io space */
+        >;
+
+        bus-range = <0 255>;
+        status = "disabled";
+
+        pciintc: interrupt-controller {
+            interrupt-controller;
+            #address-cells = <0>;
+            #interrupt-cells = <1>;
+
+            interrupt-parent = <&intc>;
+            interrupts = <24>;
+        };
+
+    };
+
+};
+
+&spi0 {
+    status = "okay";
+
+    flash@0 {
+        compatible = "jedec,spi-nor";
+        reg = <0>;
+        spi-max-frequency = <10000000>;
+
+        partitions {
+            compatible = "fixed-partitions";
+            #address-cells = <1>;
+            #size-cells = <1>;
+
+            partition@0 {
+                label = "Bootloader";
+                reg = <0x0 0x30000>;
+                read-only;
+            };
+
+            partition@30000 {
+                label = "Config";
+                reg = <0x30000 0x10000>;
+                read-only;
+            };
+
+            factory: partition@40000 {
+                label = "Factory";
+                reg = <0x40000 0x10000>;
+                read-only;
+            };
+
+            partition@50000 {
+                compatible = "denx,uimage";
+                label = "Kernel";
+                reg = <0x50000 0x7b0000>;
+            };
+        };
+    };
+};
+
+&pcie {
+    wifi@0,0 {
+        compatible = "pci1814,3091";
+        ralink,mtd-eeprom = <&factory 0x8000>;
+    };
+};
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 0000000000..4b502ec0a7
--- /dev/null
+++ b/target/linux/ramips/dts/rt6855a_linksys_wap300n.dts
@@ -0,0 +1,22 @@ 
+// SPDX-License-Identifier: GPL-2.0
+/dts-v1/;
+
+/include/ "rt6855a.dtsi"
+
+/ {
+	compatible = "ralink,rt6855a-soc";
+	model = "Linksys foobar WAP300n";
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x20000 0x3fe0000>;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,57600";
+	};
+
+	pcie@1fb80000 {
+		status = "okay";
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 4274c24884..8c916c072b 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -17,6 +17,7 @@  DEVICE_VARS += SERCOMM_PAD JCG_MAXSIZE
 loadaddr-y := 0x80000000
 loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
 loadaddr-$(CONFIG_TARGET_ramips_mt7621) := 0x80001000
+loadaddr-$(CONFIG_TARGET_ramips_rt6855a) := 0x80020000
 
 ldrplatform-y := ralink
 ldrplatform-$(CONFIG_TARGET_ramips_mt7621) := mt7621
diff --git a/target/linux/ramips/image/rt6855a.mk b/target/linux/ramips/image/rt6855a.mk
new file mode 100644
index 0000000000..678f12eb65
--- /dev/null
+++ b/target/linux/ramips/image/rt6855a.mk
@@ -0,0 +1,12 @@ 
+#
+# RT6855A Profiles
+#
+
+define Device/linksys_wap300n
+  SOC := rt6855a
+  IMAGE_SIZE := 7936k
+  DEVICE_VENDOR := Linksys
+  DEVICE_MODEL := WAP300N
+  DEVICE_PACKAGES:= kmod-rt2800-pci
+endef
+TARGET_DEVICES += linksys_wap300n
diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds b/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
new file mode 100755
index 0000000000..575a36cf40
--- /dev/null
+++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/01_leds
@@ -0,0 +1,17 @@ 
+#!/bin/sh
+
+. /lib/functions/leds.sh
+. /lib/functions/uci-defaults.sh
+
+board=$(board_name)
+
+board_config_update
+
+case $board in
+linksys,wap300n)
+	;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network b/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
new file mode 100755
index 0000000000..84753ce846
--- /dev/null
+++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/02_network
@@ -0,0 +1,17 @@ 
+#!/bin/sh
+
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+. /lib/functions/system.sh
+
+board_config_update
+
+case $board in
+linksys,wap300n)
+	ucidef_set_interface_lan "eth0"
+	;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ramips/rt6855a/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/rt6855a/base-files/etc/board.d/03_gpio_switches
new file mode 100755
index 0000000000..51f7e2dee7
--- /dev/null
+++ b/target/linux/ramips/rt6855a/base-files/etc/board.d/03_gpio_switches
@@ -0,0 +1,16 @@ 
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+
+board=$(board_name)
+
+board_config_update
+
+case $board in
+linksys,wap300n)
+	;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/ramips/rt6855a/config-5.4 b/target/linux/ramips/rt6855a/config-5.4
new file mode 100644
index 0000000000..83862e5386
--- /dev/null
+++ b/target/linux/ramips/rt6855a/config-5.4
@@ -0,0 +1,344 @@ 
+CONFIG_ARCH_32BIT_OFF_T=y
+CONFIG_ARCH_BINFMT_ELF_STATE=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MMAP_RND_BITS_MAX=15
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ASN1=y
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_ASYMMETRIC_KEY_TYPE=y
+CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
+# CONFIG_BLOCK is not set
+# CONFIG_BPF_JIT is not set
+# CONFIG_BPF_SYSCALL is not set
+CONFIG_BUILTIN_DTB=y
+# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+CONFIG_CEVT_R4K=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CLZ_TAB=y
+CONFIG_CMDLINE="console=ttyS0,57600"
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_COMPAT_BRK=y
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_LOAD_STORE_LR=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_RIXI=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+# CONFIG_CPU_MIPS32_R1 is not set
+CONFIG_CPU_MIPS32_R2=y
+CONFIG_CPU_MIPSR2=y
+CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CPU_SUPPORTS_MSA=y
+# CONFIG_CRC32_SARWATE is not set
+CONFIG_CRC32_SLICEBY8=y
+CONFIG_CRC_CCITT=y
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_AKCIPHER=y
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_CCM=y
+CONFIG_CRYPTO_CMAC=y
+CONFIG_CRYPTO_CTR=y
+CONFIG_CRYPTO_DRBG=y
+CONFIG_CRYPTO_DRBG_HMAC=y
+CONFIG_CRYPTO_DRBG_MENU=y
+CONFIG_CRYPTO_GCM=y
+CONFIG_CRYPTO_GF128MUL=y
+CONFIG_CRYPTO_GHASH=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HASH_INFO=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_HW=y
+CONFIG_CRYPTO_JITTERENTROPY=y
+CONFIG_CRYPTO_LIB_SHA256=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=y
+CONFIG_CRYPTO_RSA=y
+CONFIG_CRYPTO_SEQIV=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CSRC_R4K=y
+# CONFIG_DEBUG_FS is not set
+CONFIG_DEBUG_INFO=y
+CONFIG_DECOMPRESS_LZMA=y
+CONFIG_DEVMEM=y
+CONFIG_DMADEVICES=y
+CONFIG_DMA_API_DEBUG=y
+CONFIG_DMA_API_DEBUG_SG=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
+CONFIG_DMA_OF=y
+CONFIG_DMA_RALINK=y
+CONFIG_DMA_VIRTUAL_CHANNELS=y
+CONFIG_DST_CACHE=y
+# CONFIG_DTB_RT_NONE is not set
+CONFIG_DTB_WAP300N=y
+CONFIG_DTC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_EEPROM_93CX6=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_FHANDLE=y
+# CONFIG_FILE_LOCKING is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_FW_LOADER_USER_HELPER is not set
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_GETTIMEOFDAY=y
+CONFIG_GENERIC_IOMAP=y
+CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_LIB_ASHLDI3=y
+CONFIG_GENERIC_LIB_ASHRDI3=y
+CONFIG_GENERIC_LIB_CMPDI2=y
+CONFIG_GENERIC_LIB_LSHRDI3=y
+CONFIG_GENERIC_LIB_UCMPDI2=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GRO_CELLS=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+# CONFIG_HARDENED_USERCOPY is not set
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_HZ=100
+CONFIG_HZ_100=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_INET_DIAG=y
+# CONFIG_INET_DIAG_DESTROY is not set
+# CONFIG_INET_RAW_DIAG is not set
+CONFIG_INET_TCP_DIAG=y
+CONFIG_INET_TUNNEL=y
+CONFIG_INITRAMFS_COMPRESSION=".lzma"
+CONFIG_INITRAMFS_COMPRESSION_LZMA=y
+# CONFIG_INITRAMFS_COMPRESSION_NONE is not set
+CONFIG_INITRAMFS_ROOT_GID=0
+CONFIG_INITRAMFS_ROOT_UID=0
+CONFIG_INITRAMFS_SOURCE="../romfs2/"
+# CONFIG_INOTIFY_USER is not set
+CONFIG_IO_URING=y
+CONFIG_IPV6=y
+CONFIG_IPV6_SIT=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+# CONFIG_IP_MULTICAST is not set
+CONFIG_IRQCHIP=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_MIPS_CPU=y
+CONFIG_IRQ_WORK=y
+# CONFIG_ISDN is not set
+CONFIG_KEYS=y
+# CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set
+# CONFIG_LEDS_TRIGGERS is not set
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=8
+CONFIG_LIBFDT=y
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_LOCK_DEBUGGING_SUPPORT=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_LSM="lockdown,yama,loadpin,safesetid,integrity,bpf"
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
+CONFIG_MEMFD_CREATE=y
+CONFIG_MFD_SYSCON=y
+CONFIG_MIGRATION=y
+CONFIG_MIPS=y
+CONFIG_MIPS_ASID_BITS=8
+CONFIG_MIPS_ASID_SHIFT=0
+CONFIG_MIPS_CLOCK_VSYSCALL=y
+# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
+# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
+CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_MIPS_CMDLINE_FROM_DTB is not set
+# CONFIG_MIPS_ELF_APPENDED_DTB is not set
+CONFIG_MIPS_FP_SUPPORT=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+# CONFIG_MIPS_NO_APPENDED_DTB is not set
+CONFIG_MIPS_PLATFORM_DEVICES=y
+CONFIG_MIPS_RAW_APPENDED_DTB=y
+CONFIG_MIPS_SPRAM=y
+# CONFIG_MISC_FILESYSTEMS is not set
+CONFIG_MODULES_USE_ELF_REL=y
+# CONFIG_MODULE_STRIPPED is not set
+# CONFIG_MODULE_UNLOAD is not set
+CONFIG_MPILIB=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_INTELEXT is not set
+CONFIG_MTD_CFI_STAA=y
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_PARTITIONED_MASTER=y
+CONFIG_MTD_PHYSMAP=y
+# CONFIG_MTD_PHYSMAP_OF is not set
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
+CONFIG_MTD_SPLIT_FIRMWARE=y
+# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NET_IP_TUNNEL=y
+CONFIG_NET_RALINK_ESW_RT3050=y
+CONFIG_NET_RALINK_RT3050=y
+CONFIG_NET_RALINK_SOC=y
+# CONFIG_NET_VENDOR_ALACRITECH is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_AQUANTIA is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CADENCE is not set
+# CONFIG_NET_VENDOR_CAVIUM is not set
+# CONFIG_NET_VENDOR_CORTINA is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_GOOGLE is not set
+# CONFIG_NET_VENDOR_HUAWEI is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_MICROSEMI is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_NET_VENDOR_NI is not set
+# CONFIG_NET_VENDOR_PENSANDO is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+CONFIG_NET_VENDOR_RALINK=y
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_SOCIONEXT is not set
+# CONFIG_NET_VENDOR_SOLARFLARE is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+# CONFIG_NET_VENDOR_XILINX is not set
+CONFIG_NLS=y
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_DEFAULT="utf8"
+CONFIG_NLS_UTF8=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+CONFIG_OF=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_KOBJ=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_NET=y
+CONFIG_OID_REGISTRY=y
+# CONFIG_OVERLAY_FS is not set
+# CONFIG_PANIC_ON_OOPS is not set
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PANIC_TIMEOUT=0
+CONFIG_PCI=y
+CONFIG_PCI_DEBUG=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DRIVERS_LEGACY=y
+# CONFIG_PCI_MT7621 is not set
+# CONFIG_PCI_MT7621_PHY is not set
+# CONFIG_PCI_QUIRKS is not set
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+# CONFIG_PHY_RALINK_USB is not set
+# CONFIG_PINCTRL_RT2880 is not set
+CONFIG_PKCS7_MESSAGE_PARSER=y
+# CONFIG_PKCS8_PRIVATE_KEY_PARSER is not set
+CONFIG_PRINTK_TIME=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_STRIPPED is not set
+CONFIG_RALINK=y
+CONFIG_RALINK_WDT=y
+# CONFIG_RCU_EXPERT is not set
+CONFIG_RD_LZMA=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_MMIO=y
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RSEQ=y
+# CONFIG_RUNTIME_TESTING_MENU is not set
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SECONDARY_TRUSTED_KEYRING is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+CONFIG_SERIAL_8250_EXAR=y
+CONFIG_SERIAL_8250_NR_UARTS=1
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_RUNTIME_UARTS=1
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SGETMASK_SYSCALL=y
+CONFIG_SLAB=y
+# CONFIG_SLUB is not set
+CONFIG_SOCK_DIAG=y
+# CONFIG_SOC_MT7620 is not set
+# CONFIG_SOC_MT7621 is not set
+# CONFIG_SOC_RT288X is not set
+# CONFIG_SOC_RT305X is not set
+# CONFIG_SOC_RT3883 is not set
+CONFIG_SOC_RT6855A=y
+CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_MEM=y
+CONFIG_SPI_MT7621=y
+# CONFIG_SPI_RT2880 is not set
+CONFIG_STACKTRACE=y
+# CONFIG_STRIP_ASM_SYMS is not set
+CONFIG_SWCONFIG=y
+CONFIG_SWPHY=y
+# CONFIG_SYN_COOKIES is not set
+CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_SYSFS_SYSCALL=y
+# CONFIG_SYSTEM_EXTRA_CERTIFICATE is not set
+CONFIG_SYSTEM_TRUSTED_KEYRING=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_MIPS16=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
+CONFIG_TARGET_ISA_REV=2
+# CONFIG_TCP_CONG_ADVANCED is not set
+# CONFIG_TEXTSEARCH is not set
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_USE_OF=y
+CONFIG_VGA_ARB=y
+CONFIG_VGA_ARB_MAX_GPUS=16
+# CONFIG_VIRTIO_MENU is not set
+# CONFIG_VLAN_8021Q is not set
+CONFIG_WATCHDOG_CORE=y
+# CONFIG_WEXT_PRIV is not set
+# CONFIG_WEXT_SPY is not set
+# CONFIG_WIRELESS_EXT is not set
+CONFIG_WLAN_VENDOR_RALINK=y
+CONFIG_X509_CERTIFICATE_PARSER=y
diff --git a/target/linux/ramips/rt6855a/profiles/00-default.mk b/target/linux/ramips/rt6855a/profiles/00-default.mk
new file mode 100644
index 0000000000..c0706254c7
--- /dev/null
+++ b/target/linux/ramips/rt6855a/profiles/00-default.mk
@@ -0,0 +1,17 @@ 
+#
+# Copyright (C) 2011 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/Default
+	NAME:=Default Profile
+	PRIORITY:=1
+	PACKAGES:=
+endef
+
+define Profile/Default/Description
+	Default package set compatible with most boards.
+endef
+$(eval $(call Profile,Default))
diff --git a/target/linux/ramips/rt6855a/target.mk b/target/linux/ramips/rt6855a/target.mk
new file mode 100644
index 0000000000..0efedf4fde
--- /dev/null
+++ b/target/linux/ramips/rt6855a/target.mk
@@ -0,0 +1,15 @@ 
+#
+# Copyright (C) 2009 OpenWrt.org
+#
+
+SUBTARGET:=rt6855a
+BOARDNAME:=RT6855A based boards
+FEATURES+=ramdisk pci
+CPU_TYPE:=34kc
+
+DEFAULT_PACKAGES += wpad-basic-wolfssl swconfig
+
+define Target/Description
+	Build firmware images for Ralink RT6855A based boards.
+endef
+