ramips: add support for more model

This commit is contained in:
coolsnowwolf 2018-11-28 18:40:04 +08:00
parent ff0173989f
commit 6e9299a6b3
29 changed files with 977 additions and 71 deletions

View File

@ -17,6 +17,7 @@ case $board in
set_wifi_led "$boardname:amber:wlan"
;;
3g-6200nl|\
skylab,skw92a|\
wnce2001)
set_wifi_led "$boardname:green:wlan"
;;
@ -55,6 +56,10 @@ asl26555-16M)
ucidef_set_led_netdev "eth" "ETH" "asl26555:green:eth" "eth0"
set_wifi_led "asl26555:green:wlan"
;;
bdcom,wap2100-sk|\
hiwifi,hc5861b)
set_wifi_led "$boardname:green:wlan2g"
;;
broadway)
set_wifi_led "$boardname:red:wps_active"
;;
@ -171,9 +176,6 @@ hg255d)
set_wifi_led "$boardname:green:wlan"
ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2"
;;
hiwifi,hc5861b)
set_wifi_led "$boardname:green:wlan2g"
;;
hpm)
ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0"
set_wifi_led "$boardname:green:wifi"
@ -195,6 +197,10 @@ kn_rf|\
kng_rc)
set_wifi_led "$boardname:green:wifi"
;;
lava,lr-25g001)
ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:green:wlan2g" "wlan1"
ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:green:wlan5g" "wlan0"
;;
linkits7688)
ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt"
;;
@ -364,6 +370,14 @@ vocore-16M)
w502u)
set_wifi_led "rt2800pci-phy0::radio"
;;
wavlink,wl-wn570ha1)
ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01"
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan0" "1" "49"
ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan0" "50" "84"
ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan0" "85" "100"
set_wifi_led "$boardname:green:wifi"
;;
we1026-5g-16m)
ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0"
set_wifi_led "we1026-5g:green:wifi"

View File

@ -32,6 +32,7 @@ ramips_setup_interfaces()
case $board in
11acnas|\
d-team,newifi-d2|\
w2914nsv2|\
zbt-we2026)
ucidef_add_switch "switch0" \
@ -103,7 +104,6 @@ ramips_setup_interfaces()
mt7628|\
mzk-750dhp|\
mzk-w300nh2|\
d-team,newifi-d2|\
netgear,r6120|\
nixcore-x1-8M|\
nixcore-x1-16M|\
@ -115,8 +115,10 @@ ramips_setup_interfaces()
rt-n12p|\
sap-g3200u3|\
sk-wb8|\
u7621-06-256M-16M|\
unielec,u7621-06-256m-16m|\
unielec,u7621-06-512m-64m|\
vr500|\
wavlink,wl-wn570ha1|\
wf-2881|\
whr-g300n|\
mqmaker,witi-256m|\
@ -198,13 +200,12 @@ ramips_setup_interfaces()
atp-52b|\
awm002-evb-4M|\
awm002-evb-8M|\
bdcom,wap2100-sk|\
c20i|\
dir-645|\
f5d8235-v2|\
gl-mt300a|\
gl-mt300n|\
gl-mt750|\
hg255d|\
hiwifi,hc5861b|\
jhr-n805r|\
jhr-n825r|\
@ -213,6 +214,7 @@ ramips_setup_interfaces()
mzk-wdpr|\
rb750gr3|\
rt-n14u|\
skylab,skw92a|\
tplink,c20-v4|\
tplink,c50-v3|\
tplink,tl-mr3420-v5|\
@ -242,6 +244,7 @@ ramips_setup_interfaces()
elecom,wrc-1167ghbk2-s|\
elecom,wrc-2533gst|\
elecom,wrc-1900gst|\
hg255d|\
iodata,wn-ax1167gr|\
iodata,wn-gx300gr)
ucidef_add_switch "switch0" \
@ -349,6 +352,7 @@ ramips_setup_interfaces()
ucidef_add_switch "switch0" \
"4:lan" "6@eth0"
;;
lava,lr-25g001|\
tew-691gr|\
tew-692gr|\
wlr-6000)
@ -371,6 +375,7 @@ ramips_setup_interfaces()
"0:lan" "2:lan" "6t@eth0"
;;
f5d8235-v1|\
f5d8235-v2|\
tew-714tru|\
v11st-fe|\
wzr-agl300nh)
@ -470,7 +475,8 @@ ramips_setup_macs()
;;
dlink,dwr-116-a1|\
dlink,dwr-118-a2|\
dlink,dwr-921-c1)
dlink,dwr-921-c1|\
lava,lr-25g001)
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
@ -554,6 +560,10 @@ ramips_setup_macs()
lan_mac=$(macaddr_setbit_la "$lan_mac")
wan_mac=$(mtd_get_mac_binary factory 32772)
;;
skylab,skw92a)
lan_mac=$(mtd_get_mac_binary factory 40)
wan_mac=$(mtd_get_mac_binary factory 46)
;;
tew-691gr)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 4)" 3)
;;

View File

@ -56,7 +56,8 @@ case "$FIRMWARE" in
case $board in
dlink,dwr-116-a1|\
dlink,dwr-118-a2|\
dlink,dwr-921-c1)
dlink,dwr-921-c1|\
lava,lr-25g001)
wan_mac=$(jboot_config_read -m -i $(find_mtd_part "config") -o 0xE000)
wifi_mac=$(macaddr_add "$wan_mac" 1)
jboot_eeprom_extract "config" 0xE000

View File

@ -502,9 +502,6 @@ ramips_board_detect() {
*"U25AWF-H1")
name="u25awf-h1"
;;
*"U7621-06 (256M RAM/16M flash)")
name="u7621-06-256M-16M"
;;
*"U7628-01 (128M RAM/16M flash)")
name="u7628-01-128M-16M"
;;

View File

@ -31,6 +31,7 @@ platform_check_image() {
awm002-evb-4M|\
awm002-evb-8M|\
bc2|\
bdcom,wap2100-sk|\
bocco|\
broadway|\
c108|\
@ -151,6 +152,7 @@ platform_check_image() {
rut5xx|\
sap-g3200u3|\
sk-wb8|\
skylab,skw92a|\
sl-r7205|\
tama,w06|\
tew-638apb-v2|\
@ -160,7 +162,8 @@ platform_check_image() {
timecloud|\
tiny-ac|\
u25awf-h1|\
u7621-06-256M-16M|\
unielec,u7621-06-256m-16m|\
unielec,u7621-06-512m-64m|\
u7628-01-128M-16M|\
ur-326n4g|\
ur-336un|\
@ -176,6 +179,7 @@ platform_check_image() {
w306r-v20|\
w502u|\
ravpower,wd03|\
wavlink,wl-wn570ha1|\
wf-2881|\
whr-1166d|\
whr-300hp2|\
@ -185,6 +189,7 @@ platform_check_image() {
widora,neo-32m|\
mqmaker,witi-256m|\
mqmaker,witi-512m|\
we1026-5g-16m|\
wizfi630a|\
wl-330n|\
wl-330n3g|\
@ -216,7 +221,6 @@ platform_check_image() {
y1|\
y1s|\
youhua,wr1200js|\
we1026-5g-16m|\
zbt-ape522ii|\
zbt-cpe102|\
zbt-wa05|\
@ -293,7 +297,8 @@ platform_check_image() {
dlink,dwr-116-a1|\
dlink,dwr-118-a2|\
dlink,dwr-921-c1|\
dwr-512-b)
dwr-512-b|\
lava,lr-25g001)
[ "$magic" != "0404242b" ] && {
echo "Invalid image type."
return 1

View File

@ -0,0 +1,138 @@
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "bdcom,wap2100-sk", "ralink,mt7620a-soc";
model = "BDCOM WAP2100-SK";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
};
chosen {
bootargs = "console=ttyS0,115200";
};
gpio-leds {
compatible = "gpio-leds";
usb {
label = "wap2100-sk:green:usb";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
trigger-sources = <&ohci_port1>, <&ehci_port1>;
linux,default-trigger = "usbport";
};
led_power: wps {
label = "wap2100-sk:green:wps";
gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "wap2100-sk:green:wlan2g";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
gpio-keys-polled {
compatible = "gpio-keys-polled";
poll-interval = <20>;
wps {
label = "wps";
gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
reset {
label = "reset";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
partitions {
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0xf70000>;
};
};
};
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&gpio3 {
status = "okay";
};
&sdhci {
status = "okay";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&ethernet {
mtd-mac-address = <&factory 0x4>;
mediatek,portmap = "llllw";
};
&wmac {
ralink,mtd-eeprom = <&factory 0>;
};
&pinctrl {
state_default: pinctrl0 {
default {
ralink,group = "spi refclk", "uartf", "wled";
ralink,function = "gpio";
};
};
};

View File

@ -156,6 +156,8 @@
&sdhci {
status = "okay";
/* the pins function is already set during pinmux driver load */
/delete-property/ pinctrl-0;
};
&ehci {
@ -181,6 +183,20 @@
ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa";
ralink,function = "gpio";
};
/*
* The sd function of the nd_sd group configures two of the
* groups pins as gpios. The pins are used as PCIe reset/power.
* Due to the driver load order, the pins are configured way to
* late if triggered by the sd-card driver.
* To not introduce another kind of driver load order
* dependency and configure the pins as early as possible,
* means during pinmux driver load.
*/
gpio_sd {
ralink,group = "nd_sd";
ralink,function = "sd";
};
};
};

View File

@ -143,3 +143,11 @@
&wmac {
ralink,mtd-eeprom = <&factory 0>;
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};

View File

@ -111,7 +111,7 @@
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
ralink,group = "spi", "i2c", "jtag", "mdio", "uartf";
ralink,function = "gpio";
};
};
@ -119,10 +119,21 @@
&ethernet {
mtd-mac-address = <&uboot 0x40004>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii_pins>;
};
&esw {
ralink,rgmii = <1>;
mediatek,portmap = <0x3f>;
ralink,fct2 = <0x0002500c>;
/*
* ext phy base addr 31, rx/tx clock skew 0,
* turbo mii off, rgmi 3.3v off, port 5 polling off
* port5: enabled, gige, full-duplex, rx/tx-flow-control
* port6: enabled, gige, full-duplex, rx/tx-flow-control
*/
ralink,fpa2 = <0x1f003fff>;
};
&wmac {

View File

@ -105,11 +105,6 @@
};
};
&cpuclock {
compatible = "fixed-clock";
clock-frequency = <900000000>;
};
&pcie {
status = "okay";
};

View File

@ -115,11 +115,6 @@
};
};
&cpuclock {
compatible = "fixed-clock";
clock-frequency = <900000000>;
};
&pcie {
status = "okay";
};

View File

@ -0,0 +1,180 @@
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "lava,lr-25g001", "ralink,mt7620a-soc";
model = "LAVA LR-25G001";
aliases {
led-boot = &led_status;
led-failsafe = &led_status;
led-running = &led_status;
led-upgrade = &led_status;
};
gpio-keys-polled {
compatible = "gpio-keys-polled";
poll-interval = <20>;
wps {
label = "wps";
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
linux,code = <KEY_WPS_BUTTON>;
};
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
gpio-leds {
compatible = "gpio-leds";
led_status: status {
label = "lr-25g001:green:status";
gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
};
wifi2g {
label = "lr-25g001:green:wifi2g";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
wifi5g {
label = "lr-25g001:green:wifi5g";
gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
};
};
gpio_export {
compatible = "gpio-export";
#size-cells = <0>;
usbpower {
gpio-export,name = "usbpower";
gpio-export,output = <1>;
gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
};
};
};
&gpio0 {
status = "okay";
};
&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 = "jboot";
reg = <0x0 0x10000>;
read-only;
};
partition@10000 {
label = "firmware";
reg = <0x10000 0xfe0000>;
};
config: partition@ff0000 {
label = "config";
reg = <0xff0000 0x10000>;
read-only;
};
};
};
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
&ethernet {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
port@5 {
status = "okay";
phy-mode = "rgmii";
mediatek,fixed-link = <1000 1 1 1>;
};
mdio-bus {
status = "okay";
mediatek,mdio-mode = <1>;
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
qca,ar8327-initvals = <
0x04 0x87300000 /* PORT0 PAD MODE CTRL */
0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0_STATUS */
0x94 0x00000000 /* PORT6_STATUS */
>;
};
phy1: ethernet-phy@1 {
reg = <1>;
phy-mode = "rgmii";
};
phy2: ethernet-phy@2 {
reg = <2>;
phy-mode = "rgmii";
};
phy3: ethernet-phy@3 {
reg = <3>;
phy-mode = "rgmii";
};
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
mt76x0e@0,0 {
reg = <0x0000 0 0 0 0>;
mtd-mac-address = <&config 0xe07e>;
mtd-mac-address-increment = <(2)>;
mediatek,mtd-eeprom = <&config 0xe08a>;
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "uartf", "i2c";
ralink,function = "gpio";
};
};
};

View File

@ -135,3 +135,14 @@
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
};
};

View File

@ -0,0 +1,122 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;
#include "mt7628an.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/{
compatible = "skylab,skw92a", "mediatek,mt7628an-soc";
model = "SKYLAB SKW92A";
aliases {
led-boot = &led_power;
led-failsafe = &led_power;
};
chosen {
bootargs = "console=ttyS0,57600";
};
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
gpio-leds {
compatible = "gpio-leds";
led_power: wps {
label = "skw92a:green:wps";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
};
wlan {
label = "skw92a:green:wlan";
gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
};
};
gpio-keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "wdt", "refclk", "wled_an";
ralink,function = "gpio";
};
};
};
&ethernet {
mtd-mac-address = <&factory 0x28>;
};
&wmac {
status = "okay";
ralink,mtd-eeprom = <&factory 0x0>;
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
m25p,chunked-io = <32>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0xfb0000>;
compatible = "denx,uimage";
};
};
};
};
&uart1 {
status = "okay";
};
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};

View File

@ -0,0 +1,92 @@
/*
* BSD LICENSE
*
* Copyright(c) 2017 Kristian Evensen <kristian.evensen@gmail.com>.
* Copyright(c) 2017 Piotr Dymacz <pepe2k@gmail.com>.
* Copyright(c) 2018 Nishant Sharma <codemarauder@gmail.com>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Broadcom Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/dts-v1/;
#include "U7621-06.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "unielec,u7621-06-512m-64m", "unielec,u7621-06", "mediatek,mt7621-soc";
model = "UniElec U7621-06 (512M RAM/64M flash)";
memory@0 {
device_type = "memory";
reg = <0x0 0x1c000000>, <0x20000000 0x4000000>;
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
m25p,chunked-io = <32>;
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;
};
firmware: partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x3fb0000>;
};
};
};
};

View File

@ -1,6 +1,6 @@
/dts-v1/;
#include "mt7620a.dtsi"
#include "mt7620n.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

View File

@ -0,0 +1,136 @@
/dts-v1/;
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/gpio.h>
#include "mt7628an.dtsi"
/ {
compatible = "wavlink,wl-wn570ha1", "mediatek,mt7628an-soc";
model = "Wavlink WL-WN570HA1";
chosen {
bootargs = "console=ttyS0,57600";
};
memory@0 {
device_type = "memory";
reg = <0x0 0x4000000>;
};
gpio-keys-polled {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
gpio-leds {
compatible = "gpio-leds";
power {
label = "wl-wn570ha1:green:power";
gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
default-state = "keep";
};
wan {
label = "wl-wn570ha1:green:wan";
gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
};
wifi-high {
label = "wl-wn570ha1:green:wifi-high";
gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
};
wifi-med {
label = "wl-wn570ha1:green:wifi-med";
gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
};
wifi-low {
label = "wl-wn570ha1:green:wifi-low";
gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
};
wifi {
label = "wl-wn570ha1:green:wifi";
gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
};
};
};
&pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "wled_an", "p0led_an", "wdt", "refclk";
ralink,function = "gpio";
};
};
};
&pcie {
status = "okay";
};
&pcie0 {
wifi@0,0 {
reg = <0x0000 0 0 0 0>;
mediatek,mtd-eeprom = <&factory 0x8000>;
ieee80211-freq-limit = <5000000 6000000>;
};
};
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <10000000>;
m25p,chunked-io = <32>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0x7b0000>;
};
};
};
};
&wmac {
status = "okay";
};
&ethernet {
mtd-mac-address = <&factory 0x2e>;
mediatek,portmap = "llllw";
};

View File

@ -193,8 +193,8 @@
pci: pci@440000 {
compatible = "ralink,rt288x-pci";
reg = <0x00440000 0x20000>;
#address-cells = <1>;
#size-cells = <1>;
#address-cells = <3>;
#size-cells = <2>;
status = "disabled";
};

View File

@ -310,7 +310,7 @@
pci_pins: pci {
pci {
ralink,group = "pci";
ralink,function = "pci-host1";
ralink,function = "pci-fnc";
};
};
};

View File

@ -69,6 +69,9 @@ static int mt7620_mdio_mode(struct device_node *eth_node)
mdiobus_node = of_get_child_by_name(eth_node, "mdio-bus");
if (mdiobus_node) {
if (of_property_read_bool(mdiobus_node, "mediatek,mdio-mode"))
ret = 1;
for_each_child_of_node(mdiobus_node, phy_node) {
id = of_get_property(phy_node, "reg", NULL);
if (id && (be32_to_cpu(*id) == 0x1f))

View File

@ -49,6 +49,7 @@ define Device/ArcherC20i
TPLINK_HWID := 0xc2000001
TPLINK_HWREV := 58
IMAGES += factory.bin
DEVICE_PACKAGES := kmod-mt76x0e
DEVICE_TITLE := TP-Link ArcherC20i
endef
TARGET_DEVICES += ArcherC20i
@ -79,6 +80,14 @@ define Device/ArcherMR200
endef
TARGET_DEVICES += ArcherMR200
define Device/bdcom_wap2100-sk
DTS := BDCOM-WAP2100-SK
IMAGE_SIZE := 15808k
DEVICE_TITLE := BDCOM WAP2100-SK (ZTE ZXECS EBG3130)
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += bdcom_wap2100-sk
define Device/bocco
DTS := BOCCO
DEVICE_TITLE := YUKAI Engineering BOCCO
@ -145,8 +154,9 @@ TARGET_DEVICES += dch-m225
define Device/dir-810l
DTS := DIR-810L
IMAGE_SIZE := 6720k
DEVICE_PACKAGES := kmod-mt76x0e
DEVICE_TITLE := D-Link DIR-810L
IMAGE_SIZE := 6720k
endef
TARGET_DEVICES += dir-810l
@ -342,6 +352,21 @@ define Device/microwrt
endef
TARGET_DEVICES += microwrt
define Device/lava_lr-25g001
DTS := LR-25G001
DEVICE_TITLE := LAVA LR-25G001
DLINK_ROM_ID := LVA6E3804001
DLINK_FAMILY_MEMBER := 0x6E38
DLINK_FIRMWARE_SIZE := 0xFE0000
KERNEL := $(KERNEL_DTB)
IMAGES += factory.bin
IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-mt76 kmod-mt76x0-common \
kmod-mt76x0e
endef
TARGET_DEVICES += lava_lr-25g001
define Device/miwifi-mini
DTS := MIWIFI-MINI
IMAGE_SIZE := $(ralink_default_fw_size_16M)

View File

@ -366,14 +366,6 @@ define Device/timecloud
endef
TARGET_DEVICES += timecloud
define Device/u7621-06-256M-16M
DTS := U7621-06-256M-16M
IMAGE_SIZE := 16064k
DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash)
DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
endef
TARGET_DEVICES += u7621-06-256M-16M
define Device/ubnt-erx
DTS := UBNT-ERX
FILESYSTEMS := squashfs
@ -394,6 +386,23 @@ define Device/ubnt-erx-sfp
endef
TARGET_DEVICES += ubnt-erx-sfp
define Device/unielec_u7621-06-256m-16m
DTS := U7621-06-256M-16M
IMAGE_SIZE := 16064k
DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash)
DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
SUPPORTED_DEVICES += u7621-06-256M-16M
endef
TARGET_DEVICES += unielec_u7621-06-256m-16m
define Device/unielec_u7621-06-512m-64m
DTS := U7621-06-512M-64M
IMAGE_SIZE := 65216k
DEVICE_TITLE := UniElec U7621-06 (512M RAM/64M flash)
DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3
endef
TARGET_DEVICES += unielec_u7621-06-512m-64m
define Device/vr500
DTS := VR500
IMAGE_SIZE := 66453504

View File

@ -115,10 +115,10 @@ define Device/netgear_r6120
IMAGE_SIZE := $(ralink_default_fw_size_16M)
DEVICE_TITLE := Netgear AC1200 R6120
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
SERCOMM_KERNEL_OFFSET := 90000
SERCOMM_KERNEL_OFFSET := 0x90000
SERCOMM_HWID := CGQ
SERCOMM_HWVER := A001
SERCOMM_SWVER := 0040
SERCOMM_SWVER := 0x0040
IMAGES += factory.img
IMAGE/default := append-kernel | pad-to $$$$(BLOCKSIZE)| append-rootfs | pad-rootfs
IMAGE/sysupgrade.bin := $$(IMAGE/default) | append-metadata | check-size $$$$(IMAGE_SIZE)
@ -150,6 +150,14 @@ define Device/pbr-d1
endef
TARGET_DEVICES += pbr-d1
define Device/skylab_skw92a
DTS := SKW92A
IMAGE_SIZE := 16064k
DEVICE_TITLE := Skylab SKW92A
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci
endef
TARGET_DEVICES += skylab_skw92a
define Device/tplink_tl-wa801nd-v5
$(Device/tplink)
DTS := TL-WA801NDV5
@ -283,7 +291,7 @@ define Device/tplink_tl-wr902ac-v3
TPLINK_HWREV := 0x89
TPLINK_HWREVADD := 0x1
TPLINK_HVERSION := 3
DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
endef
TARGET_DEVICES += tplink_tl-wr902ac-v3
@ -313,6 +321,14 @@ define Device/vocore2lite
endef
TARGET_DEVICES += vocore2lite
define Device/wavlink_wl-wn570ha1
DTS := WL-WN570HA1
IMAGE_SIZE := $(ralink_default_fw_size_8M)
DEVICE_TITLE := Wavlink WL-WN570HA1
DEVICE_PACKAGES := kmod-mt76x0e
endef
TARGET_DEVICES += wavlink_wl-wn570ha1
define Device/wcr-1166ds
DTS := WCR-1166DS
BUFFALO_TAG_PLATFORM := MTK

View File

@ -329,6 +329,7 @@ define Device/f5d8235-v2
DTS := F5D8235_V2
IMAGE_SIZE := 7744k
DEVICE_TITLE := Belkin F5D8235 v2
DEVICE_PACKAGES := kmod-switch-rtl8366rb
endef
TARGET_DEVICES += f5d8235-v2

View File

@ -1,3 +1,4 @@
CONFIG_AR8216_PHY=y
CONFIG_ARCH_BINFMT_ELF_STATE=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_ARCH_DISCARD_MEMBLOCK=y
@ -57,6 +58,7 @@ CONFIG_DTB_RT_NONE=y
# CONFIG_DTB_VOCORE2 is not set
CONFIG_DTC=y
CONFIG_EARLY_PRINTK=y
CONFIG_ETHERNET_PACKET_MANGLE=y
CONFIG_FIXED_PHY=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_CLOCKEVENTS=y

View File

@ -0,0 +1,29 @@
From d41237229464ae03fe116b591e8a2fda4ffea48e Mon Sep 17 00:00:00 2001
From: Mathias Kresin <dev@kresin.me>
Date: Sun, 28 Oct 2018 12:46:55 +0100
Subject: [PATCH] MIPS: ralink: Fix mt7620 nd_sd pinmux
In case the nd_sd group is set to the sd-card function, Pins 45 + 46 are
configured as GPIOs. If they are blocked by the sd function, they can't
be used as GPIOs.
Signed-off-by: Mathias Kresin <dev@kresin.me>
Reported-by: Kristian Evensen <kristian.evensen@gmail.com>
Fixes: f576fb6a0700 ("MIPS: ralink: cleanup the soc specific pinmux
data")
Cc: stable@vger.kernel.org # v3.18+
---
arch/mips/ralink/mt7620.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/mips/ralink/mt7620.c
+++ b/arch/mips/ralink/mt7620.c
@@ -84,7 +84,7 @@ static struct rt2880_pmx_func pcie_rst_g
};
static struct rt2880_pmx_func nd_sd_grp[] = {
FUNC("nand", MT7620_GPIO_MODE_NAND, 45, 15),
- FUNC("sd", MT7620_GPIO_MODE_SD, 45, 15)
+ FUNC("sd", MT7620_GPIO_MODE_SD, 47, 13)
};
static struct rt2880_pmx_group mt7620a_pinmux_data[] = {

View File

@ -0,0 +1,51 @@
From 57fa7f2f4ef6f78ce1d30509c0d111aa3791b524 Mon Sep 17 00:00:00 2001
From: Daniel Santos <daniel.santos@pobox.com>
Date: Sun, 4 Nov 2018 20:24:32 -0600
Subject: gpio-ralink: Add support for GPIO as interrupt-controller
Signed-off-by: Daniel Santos <daniel.santos@pobox.com>
---
Documentation/devicetree/bindings/gpio/gpio-ralink.txt | 6 ++++++
drivers/gpio/gpio-ralink.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
index 5cd17f225fe3..2775449614d4 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-ralink.txt
@@ -17,6 +17,9 @@ Required properties:
Optional properties:
- ralink,gpio-base : Specify the GPIO chips base number
+- interrupt-controller : marks this as an interrupt controller
+- #interrupt-cells : a standard two-cell interrupt flag, see
+ interrupt-controller/interrupts.txt
Example:
@@ -28,6 +31,9 @@ Example:
reg = <0x600 0x34>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+
interrupt-parent = <&intc>;
interrupts = <6>;
diff --git a/drivers/gpio/gpio-ralink.c b/drivers/gpio/gpio-ralink.c
index 27910e384013..b6e30083d012 100644
--- a/drivers/gpio/gpio-ralink.c
+++ b/drivers/gpio/gpio-ralink.c
@@ -220,7 +220,7 @@ static int gpio_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
}
static const struct irq_domain_ops irq_domain_ops = {
- .xlate = irq_domain_xlate_onecell,
+ .xlate = irq_domain_xlate_twocell,
.map = gpio_map,
};
--
2.16.4

View File

@ -0,0 +1,67 @@
From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
Subject: [PATCH] Revert "mtd: nand: Remove unused chip->write_page() hook"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This reverts commit f107d7a43923a83d837b3ea3c7b7de58cd014bbd.
OpenWrt's downstream driver mtk_nand2 still uses that callback.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2577,7 +2577,7 @@ static int nand_write_page_syndrome(stru
}
/**
- * nand_write_page - write one page
+ * nand_write_page - [REPLACEABLE] write one page
* @mtd: MTD device structure
* @chip: NAND chip descriptor
* @offset: address offset within the page
@@ -2761,9 +2761,9 @@ static int nand_do_write_ops(struct mtd_
memset(chip->oob_poi, 0xff, mtd->oobsize);
}
- ret = nand_write_page(mtd, chip, column, bytes, wbuf,
- oob_required, page,
- (ops->mode == MTD_OPS_RAW));
+ ret = chip->write_page(mtd, chip, column, bytes, wbuf,
+ oob_required, page,
+ (ops->mode == MTD_OPS_RAW));
if (ret)
break;
@@ -4719,6 +4719,9 @@ int nand_scan_tail(struct mtd_info *mtd)
}
}
+ if (!chip->write_page)
+ chip->write_page = nand_write_page;
+
/*
* Check ECC mode, default to software if 3byte/512byte hardware ECC is
* selected and we have 256 byte pagesize fallback to software ECC
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -862,6 +862,7 @@ struct nand_manufacturer_ops {
* structure which is shared among multiple independent
* devices.
* @priv: [OPTIONAL] pointer to private chip data
+ * @write_page: [REPLACEABLE] High-level page write function
* @manufacturer: [INTERN] Contains manufacturer information
*/
@@ -885,6 +886,9 @@ struct nand_chip {
int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
int (*erase)(struct mtd_info *mtd, int page);
int (*scan_bbt)(struct mtd_info *mtd);
+ int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
+ uint32_t offset, int data_len, const uint8_t *buf,
+ int oob_required, int page, int raw);
int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
int feature_addr, uint8_t *subfeature_para);
int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,

View File

@ -18,37 +18,9 @@
if (ret < 0) {
if (use_bufpoi)
/* Invalidate page cache */
@@ -2761,9 +2765,14 @@ static int nand_do_write_ops(struct mtd_
memset(chip->oob_poi, 0xff, mtd->oobsize);
}
- ret = nand_write_page(mtd, chip, column, bytes, wbuf,
- oob_required, page,
- (ops->mode == MTD_OPS_RAW));
+ if (chip->write_page)
+ ret = chip->write_page(mtd, chip, column, bytes, wbuf,
+ oob_required, page,
+ (ops->mode == MTD_OPS_RAW));
+ else
+ ret = nand_write_page(mtd, chip, column, bytes, wbuf,
+ oob_required, page,
+ (ops->mode == MTD_OPS_RAW));
if (ret)
break;
--- a/include/linux/mtd/rawnand.h
+++ b/include/linux/mtd/rawnand.h
@@ -885,6 +885,9 @@ struct nand_chip {
int(*waitfunc)(struct mtd_info *mtd, struct nand_chip *this);
int (*erase)(struct mtd_info *mtd, int page);
int (*scan_bbt)(struct mtd_info *mtd);
+ int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
+ uint32_t offset, int data_len, const uint8_t *buf,
+ int oob_required, int page, int raw);
int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip,
int feature_addr, uint8_t *subfeature_para);
int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
@@ -893,6 +896,9 @@ struct nand_chip {
@@ -897,6 +897,9 @@ struct nand_chip {
int (*setup_data_interface)(struct mtd_info *mtd, int chipnr,
const struct nand_data_interface *conf);