brcm63xx: initial support for Sky SR102 router
authorAndrius Štikonas <andrius@stikonas.eu>
Sat, 14 Jul 2018 21:53:47 +0000 (21:53 +0000)
committerJohn Crispin <john@phrozen.org>
Mon, 16 Jul 2018 13:12:08 +0000 (15:12 +0200)
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
SOC:      BCM63168 (BMIPS4350 V8.0 @400MHz)
Flash size: 16 MiB
RAM size:   128 MiB

Heavily based on patch for OpenWRT Chaos Chalmer.
Original patch and more info can be found at:
https://openwrt.org/toh/sky/sr102

Known issues:
 - Wireless and ADSL modem are not working.

Signed-off-by: Andrius Štikonas <andrius@stikonas.eu>
target/linux/brcm63xx/base-files/etc/board.d/02_network
target/linux/brcm63xx/base-files/etc/diag.sh
target/linux/brcm63xx/base-files/lib/brcm63xx.sh
target/linux/brcm63xx/dts/sr102.dts [new file with mode: 0644]
target/linux/brcm63xx/image/bcm63xx.mk
target/linux/brcm63xx/patches-4.9/598-board_sr102.patch [new file with mode: 0644]
target/linux/brcm63xx/profiles/sky.mk [new file with mode: 0644]

index a7fd6f5d38af887cea66f3158af704d832fcf533..a2ca5a37b34492290a9db8d45abab3ccc591399c 100755 (executable)
@@ -130,6 +130,12 @@ neufbox6)
                "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "9t@eth0"
        ;;
 
+sr102)
+       ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+       ucidef_add_switch "switch0" \
+               "0:lan" "1:lan" "2:lan" "3:wan" "8t@eth0"
+       ;;
+
 vg50)
        ucidef_add_switch "switch0" \
                "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "8t@eth0"
index acb1795214e496054d0a107d05d734c5e17b79be..afb347818f14ec2d7f997c81234b8e0b9fb4bee3 100644 (file)
@@ -132,6 +132,10 @@ set_state() {
        rta770w)
                status_led="RTA770W:green:diag"
                ;;
+       sr102)
+               status_led="SR102:white:power"
+               status_led2="SR102:red:power"
+               ;;
        spw500v)
                status_led="SPW500V:green:power"
                ;;
index 82abd737ce504772dd9fb3650137c68b5fbba567..1676ae0abbede979f5e4b0ec06a64c4cc66ffd45 100755 (executable)
@@ -237,6 +237,9 @@ brcm63xx_dt_detect() {
        "SFR neufbox 6 (Sercomm)")
                board_name="neufbox6"
                ;;
+       "SKY SR102")
+               board_name="sr102"
+               ;;
        "T-Com Speedport W303 V")
                board_name="spw303v"
                ;;
diff --git a/target/linux/brcm63xx/dts/sr102.dts b/target/linux/brcm63xx/dts/sr102.dts
new file mode 100644 (file)
index 0000000..4d8cbd3
--- /dev/null
@@ -0,0 +1,120 @@
+/dts-v1/;
+
+#include "bcm63268.dtsi"
+
+#include <dt-bindings/input/input.h>
+
+/ {
+       model = "SKY SR102";
+       compatible = "sky,sr102", "brcm,bcm63268";
+
+       chosen {
+               bootargs = "rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200";
+               stdout-path = "serial0:115200n8";
+       };
+
+       gpio-keys-polled {
+               compatible = "gpio-keys-polled";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               poll-interval = <20>;
+               debounce-interval = <60>;
+
+               wps {
+                       label = "wps";
+                       gpios = <&pinctrl 33 0>;
+                       linux,code = <KEY_WPS_BUTTON>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               lan1_green {
+                       label = "SR102:green:lan1";
+                       gpios = <&pinctrl 1 1>;
+               };
+               power_red {
+                       label = "SR102:red:power";
+                       gpios = <&pinctrl 2 1>;
+               };
+               wifi_red {
+                       label = "SR102:red:wifi";
+                       gpios = <&pinctrl 3 1>;
+               };
+               inet_red {
+                       label = "SR102:red:inet";
+                       gpios = <&pinctrl 4 1>;
+               };
+               inet_white {
+                       label = "SR102:white:inet";
+                       gpios = <&pinctrl 5 0>;
+               };
+               power_white {
+                       label = "SR102:white:power";
+                       gpios = <&pinctrl 6 0>;
+                       default-state = "on";
+               };
+               wifi_white {
+                       label = "SR102:white:wifi";
+                       gpios = <&pinctrl 8 0>;
+               };
+               lan2_red {
+                       label = "SR102:red:lan2";
+                       gpios = <&pinctrl 9 1>;
+               };
+               lan3_red {
+                       label = "SR102:red:lan3";
+                       gpios = <&pinctrl 10 1>;
+               };
+               lan4_red {
+                       label = "SR102:red:lan4";
+                       gpios = <&pinctrl 11 1>;
+               };
+               lan1_red {
+                       label = "SR102:red:lan1";
+                       gpios = <&pinctrl 12 1>;
+               };
+               lan2_green {
+                       label = "SR102:green:lan2";
+                       gpios = <&pinctrl 13 0>;
+               };
+               lan3_green {
+                       label = "SR102:green:lan3";
+                       gpios = <&pinctrl 14 1>;
+               };
+               lan4_green {
+                       label = "SR102:green:lan4";
+                       gpios = <&pinctrl 15 1>;
+               };
+               hd_white {
+                       label = "SR102:white:hd";
+                       gpios = <&pinctrl 18 0>;
+               };
+       };
+};
+
+&hsspi {
+       status = "ok";
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               spi-max-frequency = <16666667>;
+               spi-tx-bus-width = <2>;
+               spi-rx-bus-width = <2>;
+               reg = <0>;
+
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               linux,part-probe = "bcm63xxpart";
+
+               partitions {
+                       compatible = "brcm,bcm963xx-cfe-nor-partitions";
+               };
+       };
+};
+
+&uart0 {
+       status = "ok";
+};
index b9ecd5406433cebdb4d0305147aa0578c762fbd1..6a2a9bfb4ac06082fa07c6f0ac706216ff8e2fd8 100644 (file)
@@ -1020,6 +1020,18 @@ define Device/NEUFBOX6
 endef
 TARGET_DEVICES += NEUFBOX6
 
+define Device/SR102
+  $(Device/bcm63xx)
+  DEVICE_TITLE := SKY-SR102
+  DEVICE_DTS := sr102
+  CFE_BOARD_ID := BSKYB_63168
+  CFE_CHIP_ID := 63268
+  CFE_EXTRAS += --rsa-signature "$(VERSION_DIST)-$(firstword $(subst -,$(space),$(REVISION)))"
+  DEVICE_PACKAGES := \
+    $(B43_PACKAGES) $(USB2_PACKAGES)
+endef
+TARGET_DEVICES += SR102
+
 ### T-Com ###
 define Device/SPW303V
   $(Device/bcm63xx)
diff --git a/target/linux/brcm63xx/patches-4.9/598-board_sr102.patch b/target/linux/brcm63xx/patches-4.9/598-board_sr102.patch
new file mode 100644 (file)
index 0000000..1a9578e
--- /dev/null
@@ -0,0 +1,75 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -2457,6 +2457,56 @@
+               },
+       },
+ };
++
++static struct board_info __initdata board_BSKYB_63168 = {
++      .name                           = "BSKYB_63168",
++      .expected_cpu_id                = 0x63268,
++
++      .has_pci                        = 1,
++      .use_fallback_sprom             = 0,
++
++      .has_ehci0                      = 1,
++      .has_ohci0                      = 1,
++      .num_usbh_ports                 = 2,
++
++      .has_enetsw                     = 1,
++
++      .enetsw = {
++              .used_ports = {
++                      [0] = {
++                              .used   = 1,
++                              .phy_id = 1,
++                              .name   = "Port 1",
++                      },
++
++                      [1] = {
++                              .used   = 1,
++                              .phy_id = 2,
++                              .name   = "Port 2",
++                      },
++
++                      [2] = {
++                              .used   = 1,
++                              .phy_id = 3,
++                              .name   = "Port 3",
++                      },
++
++                      [3] = {
++                              .used   = 1,
++                              .phy_id = 4,
++                              .name   = "Port 4",
++                      },
++
++              },
++      },
++/*
++      .fallback_sprom = {
++              .type                           = SPROM_BCM435F,
++              .pci_bus                        = 0,
++              .pci_dev                        = 0,
++      },
++*/
++};
+ #endif /* CONFIG_BCM63XX_CPU_63268 */
+ /*
+@@ -2557,6 +2609,7 @@
+       &board_963268bu_p300,
+       &board_963269bhr,
+       &board_vw6339gu,
++      &board_BSKYB_63168,
+ #endif
+ };
+@@ -2661,6 +2714,7 @@
+       { .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, },
+       { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, },
+       { .compatible = "inteno,vg50", .data = &board_vw6339gu, },
++      { .compatible = "sky,sr102", .data = &board_BSKYB_63168, },
+ #endif
+ #endif /* CONFIG_OF */
+       { },
diff --git a/target/linux/brcm63xx/profiles/sky.mk b/target/linux/brcm63xx/profiles/sky.mk
new file mode 100644 (file)
index 0000000..f209794
--- /dev/null
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2015 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/SR102
+  NAME:=SKY SR102
+  PACKAGES:=kmod-b43 wpad-mini \
+       kmod-usb2 kmod-usb-ohci
+endef
+define Profile/SR102/Description
+  Package set optimized for SKY SR102.
+endef
+$(eval $(call Profile,SR102))