[openwrt/openwrt] bmips: add support for Sagem F at ST3864OP
LEDE Commits
lede-commits at lists.infradead.org
Wed Jun 26 13:44:57 PDT 2024
noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f637cf5ef73bbecaf6183e5c416e3043a5f1e202
commit f637cf5ef73bbecaf6183e5c416e3043a5f1e202
Author: Hang Zhou <929513338 at qq.com>
AuthorDate: Thu Mar 21 02:23:46 2024 +1100
bmips: add support for Sagem F at ST3864OP
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 at qq.com>
[refactor, reorder, drop unneeded or not working stuff]
Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
.../bcm63268/base-files/etc/board.d/02_network | 1 +
.../bcm63268/base-files/lib/upgrade/platform.sh | 3 +-
.../bmips/dts/bcm63168-sagem-fast-3864-op.dts | 283 +++++++++++++++++++++
target/linux/bmips/image/bcm63268.mk | 20 ++
4 files changed, 306 insertions(+), 1 deletion(-)
diff --git a/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network b/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
index 74b74691cb..328fb13df4 100644
--- a/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
+++ b/target/linux/bmips/bcm63268/base-files/etc/board.d/02_network
@@ -18,6 +18,7 @@ sercomm,h500-s-vfes)
uci add_list firewall. at 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"
diff --git a/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh b/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh
index fd309d3809..00b23f742f 100644
--- a/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh
+++ b/target/linux/bmips/bcm63268/base-files/lib/upgrade/platform.sh
@@ -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
index 0000000000..d4c76cdf7c
--- /dev/null
+++ b/target/linux/bmips/dts/bcm63168-sagem-fast-3864-op.dts
@@ -0,0 +1,283 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "bcm63268.dtsi"
+
+/ {
+ model = "Sagemcom F at 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";
+};
+
+ðernet {
+ 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 at 0 {
+ reg = <0>;
+ active-low;
+ function = LED_FUNCTION_WPS;
+ color = <LED_COLOR_ID_GREEN>;
+ };
+
+ led at 1 {
+ reg = <1>;
+ active-low;
+ function = LED_FUNCTION_WPS;
+ color = <LED_COLOR_ID_RED>;
+ };
+
+ led at 2 {
+ reg = <2>;
+ active-low;
+ label = "red:internet";
+ };
+
+ led at 3 {
+ reg = <3>;
+ active-low;
+ label = "green:dsl";
+ };
+
+ led at 4 {
+ reg = <4>;
+ active-low;
+ label = "green:fxs";
+ };
+
+ led at 5 {
+ reg = <5>;
+ active-low;
+ label = "red:fxs";
+ };
+
+ led at 8 {
+ reg = <8>;
+ active-low;
+ label = "green:internet";
+ };
+
+ led at 9 {
+ reg = <9>;
+ active-low;
+ label = "green:dsl_bonding";
+ };
+
+ led_power_red: led at 15 {
+ reg = <15>;
+ active-low;
+ function = LED_FUNCTION_POWER;
+ color = <LED_COLOR_ID_RED>;
+ };
+
+ led_power_green: led at 20 {
+ reg = <20>;
+ active-low;
+ function = LED_FUNCTION_POWER;
+ color = <LED_COLOR_ID_GREEN>;
+ };
+};
+
+&mdio_ext {
+ switch at 1e {
+ compatible = "brcm,bcm53125";
+ reg = <0x1e>;
+
+ dsa,member = <1 0>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port at 1 {
+ reg = <1>;
+ label = "lan4";
+ };
+
+ port at 2 {
+ reg = <2>;
+ label = "lan3";
+ };
+
+ port at 3 {
+ reg = <3>;
+ label = "lan2";
+ };
+
+ port at 4 {
+ reg = <4>;
+ label = "lan1";
+ };
+
+ port at 8 {
+ reg = <8>;
+
+ phy-mode = "rgmii";
+ ethernet = <&switch0port4>;
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ asym-pause;
+ pause;
+ };
+ };
+ };
+ };
+};
+
+&nflash {
+ status = "okay";
+
+ nandcs at 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 at 0 {
+ label = "cferom_nvram";
+ reg = <0x00000000 0x00020000>;
+ read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_cferom_6a0: macaddr at 6a0 {
+ reg = <0x6a0 0x6>;
+ };
+ };
+ };
+
+ partition at 20000 {
+ compatible = "brcm,wfi-split";
+ label = "wfi";
+ reg = <0x00020000 0x7ac0000>;
+ };
+
+ partition at 7ae0000 {
+ label = "stock_hidden1";
+ reg = <0x07ae0000 0x0020000>;
+ read-only;
+ };
+
+ partition at 7b00000 {
+ label = "stock_data";
+ reg = <0x07b00000 0x0400000>;
+ read-only;
+ };
+
+ partition at 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 at 3 {
+ reg = <3>;
+ label = "wan";
+
+ phy-handle = <&phy4>;
+ };
+
+ switch0port4: port at 4 {
+ reg = <4>;
+ label = "extsw";
+
+ phy-mode = "rgmii";
+
+ fixed-link {
+ speed = <1000>;
+ full-duplex;
+ };
+ };
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&usbh {
+ status = "okay";
+};
diff --git a/target/linux/bmips/image/bcm63268.mk b/target/linux/bmips/image/bcm63268.mk
index be3403174e..ed45bead7f 100644
--- a/target/linux/bmips/image/bcm63268.mk
+++ b/target/linux/bmips/image/bcm63268.mk
@@ -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 at 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
More information about the lede-commits
mailing list