Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lantiq: add basic support for AVM FRITZ!Box 7490 #2738

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -211,6 +211,7 @@
compatible = "lantiq,xrx200-pinctrl";
#gpio-cells = <2>;
gpio-controller;
gpio-ranges = <&gpio 0 0 56>;
reg = <0xe100b10 0xa0>;

gphy0_led0_pins: gphy0-led0 {
Expand Down
@@ -0,0 +1,284 @@
/dts-v1/;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Missing SPDX License identifier

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop this line:

/dts-v1/;

Ref: 7f8a1fc


#include "vr9.dtsi"

#include <dt-bindings/input/input.h>
#include <dt-bindings/mips/lantiq_rcu_gphy.h>

/ {
compatible = "avm,fritz7490", "lantiq,xway", "lantiq,vr9";
model = "AVM FRITZ!Box 7490";

chosen {
bootargs = "console=ttyLTQ0,115200";
};

aliases {
led-boot = &led_power;
led-failsafe = &led_info_red;
led-running = &led_power;
led-upgrade = &led_info_red;

led-dsl = &led_internet;
led-wifi = &led_wlan;
};

memory@0 {
device_type = "memory";
reg = <0x0 0x10000000>;
};

keys {
compatible = "gpio-keys-polled";
poll-interval = <100>;

dect {
label = "dect";
gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_PHONE>;
};

wlan {
label = "wlan";
gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RFKILL>;
};
};

leds {
compatible = "gpio-leds";

led_power: power {
label = "fritz7490:green:power";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop model name from LED label
Ref: c331932

gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
default-state = "keep";
};

led_internet: internet {
label = "fritz7490:green:internet";
gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
};

led_fixedline {
label = "fritz7490:green:fixedline";
gpios = <&gpio 36 GPIO_ACTIVE_LOW>;
};

led_wlan: wlan {
label = "fritz7490:green:wlan";
gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
};

led_info_green {
label = "fritz7490:green:info";
gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
};

led_info_red: info_red {
label = "fritz7490:red:info";
gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
};
};

gpio-export {
compatible = "gpio-export";

gpio_wasp_reset {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this as long as wsap is not working.

gpio-export,name = "fritz7490:wasp:reset";
gpio-export,output = <1>;
gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
};

gpio_wasp_wakeup {
hvegh marked this conversation as resolved.
Show resolved Hide resolved
gpio-export,name = "fritz7490:wasp:wakeup";
gpio-export,output = <2>;
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
};
};
};

&eth0 {
interface@0 {
compatible = "lantiq,xrx200-pdi";
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
lantiq,switch;

ethernet@0 {
compatible = "lantiq,xrx200-pdi-port";
reg = <0>;
phy-mode = "sgmii";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wiki Page says it have AR8035 and this PHY support RGMII

phy-handle = <&phy0>;
gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
};

ethernet@1 {
compatible = "lantiq,xrx200-pdi-port";
reg = <1>;
phy-mode = "sgmii";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

phy-handle = <&phy1>;
gpios = <&gpio 44 GPIO_ACTIVE_HIGH>;
};

ethernet@2 {
compatible = "lantiq,xrx200-pdi-port";
reg = <2>;
phy-mode = "gmii";
phy-handle = <&phy11>;
};

ethernet@4 {
compatible = "lantiq,xrx200-pdi-port";
reg = <4>;
phy-mode = "gmii";
phy-handle = <&phy13>;
};

ethernet@5 {
compatible = "lantiq,xrx200-pdi-port";
reg = <5>;
phy-mode = "rgmii";

fixed-link {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The xrx200 driver does not support fixed links unless you add a patch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, do you mean this one?:

andyboeh@9eeecc7#diff-53548cba5fb20e52886933f9e46e869e

Then the question needs tobe resolved how do we register this port in the userspace domain, I can imagine we need to label it as "wan" but I am not sure of the implications...

ucidef_add_switch "switch0"
"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0"

Copy link
Author

@hvegh hvegh Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm and.. possibly they hooked up the Xilinx to port 3 maybe.

If this is true this could open up some interesting possibilities... an onboard programmable FPGA on the network ... :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I meant this commit. Without it, the lines regarding fixed-link are useless.

There is an ongoing discussion on the labeling of this port in the 3390 PR. My point of view is that it should bear a "lan" label, because the WiFi Access Point is connected to it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would agree. (I was under the wrong impression that fixed link meant the DSL soc...)
ucidef_add_switch "switch0"
"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:lan:5" "6t@eth0"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it means that the kernel fakes a PHY and an MDIO bus at the given port with the given speed / settings.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this till it is really supported.

speed = <1000>;
full-duplex;
};
};
};

mdio {
#address-cells = <1>;
#size-cells = <0>;
compatible = "lantiq,xrx200-mdio";

phy0: ethernet-phy@0 {
reg = <0x0>;
compatible = "ethernet-phy-ieee802.3-c22";
};

phy1: ethernet-phy@1 {
reg = <0x1>;
compatible = "ethernet-phy-ieee802.3-c22";
};

phy11: ethernet-phy@11 {
reg = <0x11>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
};

phy13: ethernet-phy@13 {
reg = <0x13>;
compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22";
};
};
};

&gphy0 {
lantiq,gphy-mode = <GPHY_MODE_GE>;
};

&gphy1 {
lantiq,gphy-mode = <GPHY_MODE_GE>;
};

&gpio {
pinctrl-names = "default";
pinctrl-0 = <&state_default>;

state_default: pinmux {

phy-rst {
lantiq,pins = "io32", "io44";
lantiq,pull = <0>;
lantiq,open-drain;
lantiq,output = <1>;
};

pcie-rst {
lantiq,pins = "io21";
lantiq,open-drain;
lantiq,output = <1>;
};
};

pcie-rst-dev {
gpio-hog;
line-name = "pcie-rst-dev";
gpios = <22 GPIO_ACTIVE_LOW>;
output-low;
};

usb-vbus {
gpio-hog;
line-name = "usb-vbus";
gpios = <14 GPIO_ACTIVE_HIGH>;
output-low;
};
};

&spi {
status = "okay";

flash@4 {
compatible = "jedec,spi-nor";
reg = <4>;
spi-max-frequency = <33250000>;

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
reg = <0x0 0x40000>;
label = "urlader";
read-only;
};

partition@40000 {
reg = <0x40000 0x60000>;
label = "tffs (1)";
read-only;
};

partition@a0000 {
reg = <0xa0000 0x60000>;
label = "tffs (2)";
read-only;
};
};
};
};

&localbus {
flash@1 {
compatible = "lantiq,nand-xway";
bank-width = <1>;
reg = <1 0x0 0x2000000>;
hvegh marked this conversation as resolved.
Show resolved Hide resolved

nand-ecc-mode = "on-die";

partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "kernel";
reg = <0x0 0x400000>;
};

partition@400000 {
label = "ubi";
reg = <0x400000 0x1fc00000>;
};
};
};
};

&pcie0 {
status = "okay";

gpio-reset = <&gpio 21 GPIO_ACTIVE_LOW>;
hvegh marked this conversation as resolved.
Show resolved Hide resolved
};
10 changes: 10 additions & 0 deletions target/linux/lantiq/image/vr9.mk
Expand Up @@ -146,6 +146,16 @@ define Device/avm_fritz7412
endef
TARGET_DEVICES += avm_fritz7412

define Device/avm_fritz7490
$(Device/AVM)
$(Device/NAND)
DEVICE_MODEL := FRITZ!Box 7490
KERNEL_SIZE := 4096k
IMAGE_SIZE := 49152k
DEVICE_PACKAGES := kmod-usb3 fritz-tffs
endef
TARGET_DEVICES += avm_fritz7490

define Device/bt_homehub-v5a
$(Device/NAND)
DEVICE_VENDOR := British Telecom
Expand Down
6 changes: 4 additions & 2 deletions target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
Expand Up @@ -39,7 +39,8 @@ lantiq_setup_interfaces()
avm,fritz3370-rev2-hynix|\
avm,fritz3370-rev2-micron|\
avm,fritz7360sl|\
avm,fritz7362sl)
avm,fritz7362sl|\
avm,fritz7490)
ucidef_add_switch "switch0" \
"0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0"
;;
Expand Down Expand Up @@ -130,7 +131,8 @@ lantiq_setup_macs()
avm,fritz7360sl)
wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 0xa91)" 1)
;;
avm,fritz7362sl)
avm,fritz7362sl|\
avm,fritz7490)
lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
wan_mac=$(fritz_tffs -n macdsl -i $(find_mtd_part "tffs (1)"))
;;
Expand Down