bmips: add support for Sagem F@ST3864OP
authorHang Zhou <929513338@qq.com>
Wed, 20 Mar 2024 15:23:46 +0000 (02:23 +1100)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Wed, 26 Jun 2024 17:28:13 +0000 (19:28 +0200)
Specifications:
* SoC: BCM63168
* RAM: NT5CC64M16GP-DI, DDR3 128MiB
* NAND: W29N01HVSINA, 128MiB
* Ethernet: 4x1000M LAN, 1x 1000M WAN
* Serial interface: on board but not populated, 3.3V, 115200, 8N1

Notes:
* Use DSA for VLAN and switches
* Ethernet ports and USB works
* gpio-leds are not working
* WLAN, xDSL, and FXS are not going to work

Signed-off-by: Hang Zhou <929513338@qq.com>
[refactor, reorder, drop unneeded or not working stuff]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh
target/linux/bmips/dts/bcm63168-sagem-fast-3864-op.dts [new file with mode: 0644]
target/linux/bmips/image/bcm63268.mk

index 74b74691cbd4b86ef0d2645848d431c2fdc169e7..328fb13df486216706bf07c13ceedd14b780ed7f 100644 (file)
@@ -18,6 +18,7 @@ sercomm,h500-s-vfes)
        uci add_list firewall.@zone[0].network='qtn'
        ;;
 comtrend,vg-8050 |\
+sagem,fast-3864-op |\
 sercomm,shg2500)
        ucidef_set_bridge_device switch
        ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
index fd309d380994f204449fe38596920f0549d06d1d..00b23f742f9b8589b267b0acf334733c08021621 100644 (file)
@@ -10,7 +10,8 @@ platform_check_image() {
 platform_do_upgrade() {
        case "$(board_name)" in
        comtrend,vg-8050 |\
-       comtrend,vr-3032u)
+       comtrend,vr-3032u |\
+       sagem,fast-3864-op)
                CI_JFFS2_CLEAN_MARKERS=1
                nand_do_upgrade "$1"
                ;;
diff --git a/target/linux/bmips/dts/bcm63168-sagem-fast-3864-op.dts b/target/linux/bmips/dts/bcm63168-sagem-fast-3864-op.dts
new file mode 100644 (file)
index 0000000..d4c76cd
--- /dev/null
@@ -0,0 +1,283 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "bcm63268.dtsi"
+
+/ {
+       model = "Sagemcom F@ST 3864 OP";
+       compatible = "sagem,fast-3864-op", "brcm,bcm63168", "brcm,bcm63268";
+
+       aliases {
+               led-boot = &led_power_green;
+               led-failsafe = &led_power_red;
+               led-running = &led_power_green;
+               led-upgrade = &led_power_green;
+       };
+
+       keys {
+               compatible = "gpio-keys-polled";
+               poll-interval = <100>;
+
+               reset {
+                       label = "reset";
+                       gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_RESTART>;
+                       debounce-interval = <60>;
+               };
+
+               wps {
+                       label = "wps";
+                       gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WPS_BUTTON>;
+                       debounce-interval = <60>;
+               };
+
+               wlan {
+                       label = "wlan";
+                       gpios = <&gpio 34 GPIO_ACTIVE_LOW>;
+                       linux,code = <KEY_WLAN>;
+                       debounce-interval = <60>;
+               };
+       };
+};
+
+&ehci {
+       status = "okay";
+};
+
+&ethernet {
+       status = "okay";
+
+       nvmem-cells = <&macaddr_cferom_6a0>;
+       nvmem-cell-names = "mac-address";
+};
+
+&leds {
+       status = "okay";
+       brcm,serial-leds;
+       brcm,serial-dat-low;
+       brcm,serial-shift-inv;
+       brcm,serial-mux;
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led>;
+
+       led@0 {
+               reg = <0>;
+               active-low;
+               function = LED_FUNCTION_WPS;
+               color = <LED_COLOR_ID_GREEN>;
+       };
+
+       led@1 {
+               reg = <1>;
+               active-low;
+               function = LED_FUNCTION_WPS;
+               color = <LED_COLOR_ID_RED>;
+       };
+
+       led@2 {
+               reg = <2>;
+               active-low;
+               label = "red:internet";
+       };
+
+       led@3 {
+               reg = <3>;
+               active-low;
+               label = "green:dsl";
+       };
+
+       led@4 {
+               reg = <4>;
+               active-low;
+               label = "green:fxs";
+       };
+
+       led@5 {
+               reg = <5>;
+               active-low;
+               label = "red:fxs";
+       };
+
+       led@8 {
+               reg = <8>;
+               active-low;
+               label = "green:internet";
+       };
+
+       led@9 {
+               reg = <9>;
+               active-low;
+               label = "green:dsl_bonding";
+       };
+
+       led_power_red: led@15 {
+               reg = <15>;
+               active-low;
+               function = LED_FUNCTION_POWER;
+               color = <LED_COLOR_ID_RED>;
+       };
+
+       led_power_green: led@20 {
+               reg = <20>;
+               active-low;
+               function = LED_FUNCTION_POWER;
+               color = <LED_COLOR_ID_GREEN>;
+       };
+};
+
+&mdio_ext {
+       switch@1e {
+               compatible = "brcm,bcm53125";
+               reg = <0x1e>;
+
+               dsa,member = <1 0>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan4";
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan1";
+                       };
+
+                       port@8 {
+                               reg = <8>;
+
+                               phy-mode = "rgmii";
+                               ethernet = <&switch0port4>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       asym-pause;
+                                       pause;
+                               };
+                       };
+               };
+       };
+};
+
+&nflash {
+       status = "okay";
+
+       nandcs@0 {
+               compatible = "brcm,nandcs";
+               reg = <0>;
+               nand-ecc-step-size = <512>;
+               nand-ecc-strength = <15>;
+               nand-on-flash-bbt;
+               brcm,nand-oob-sector-size = <64>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "cferom_nvram";
+                               reg = <0x00000000 0x00020000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       macaddr_cferom_6a0: macaddr@6a0 {
+                                               reg = <0x6a0 0x6>;
+                                       };
+                               };
+                       };
+
+                       partition@20000 {
+                               compatible = "brcm,wfi-split";
+                               label = "wfi";
+                               reg = <0x00020000 0x7ac0000>;
+                       };
+
+                       partition@7ae0000 {
+                               label = "stock_hidden1";
+                               reg = <0x07ae0000 0x0020000>;
+                               read-only;
+                       };
+
+                       partition@7b00000 {
+                               label = "stock_data";
+                               reg = <0x07b00000 0x0400000>;
+                               read-only;
+                       };
+
+                       partition@7f00000 {
+                               label = "stock_hidden2";
+                               reg = <0x07f00000 0x0100000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&ohci {
+       status = "okay";
+};
+
+&pcie {
+       status = "okay";
+};
+
+&pinctrl {
+       pinctrl_leds: leds {
+               function = "led";
+               pins = "gpio8", "gpio9", "gpio15",
+                      "gpio20";
+       };
+};
+
+&switch0 {
+       dsa,member = <0 0>;
+
+       ports {
+               port@3 {
+                       reg = <3>;
+                       label = "wan";
+
+                       phy-handle = <&phy4>;
+               };
+
+               switch0port4: port@4 {
+                       reg = <4>;
+                       label = "extsw";
+
+                       phy-mode = "rgmii";
+
+                       fixed-link {
+                               speed = <1000>;
+                               full-duplex;
+                       };
+               };
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usbh {
+       status = "okay";
+};
index be3403174efc01dd68d0a52ad3cd9d3aea94dc40..ed45bead7f8bf0f23d91aa5ef2786a44b1ddd51c 100644 (file)
@@ -38,6 +38,26 @@ define Device/comtrend_vr-3032u
 endef
 TARGET_DEVICES += comtrend_vr-3032u
 
+define Device/sagem_fast-3864-op
+  $(Device/bcm63xx-nand)
+  DEVICE_VENDOR := Sagemcom
+  DEVICE_MODEL := F@ST 3864
+  DEVICE_VARIANT := OP
+  CHIP_ID := 63268
+  SOC := bcm63168
+  CFE_RAM_FILE := sagem,fast-3864-op/cferam.000
+  CFE_RAM_JFFS2_NAME := cferam.000
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  SUBPAGESIZE := 512
+  VID_HDR_OFFSET := 2048
+  DEVICE_PACKAGES += $(USB2_PACKAGES) \
+    kmod-leds-bcm6328
+  CFE_WFI_FLASH_TYPE := 3
+  CFE_WFI_VERSION := 0x5732
+endef
+TARGET_DEVICES += sagem_fast-3864-op
+
 define Device/sercomm_h500-s-lowi
   $(Device/sercomm-nand)
   DEVICE_VENDOR := Sercomm