diff --git a/target/linux/bcm53xx/base-files/etc/board.d/01_leds b/target/linux/bcm53xx/base-files/etc/board.d/01_leds index aba526b9c3..6f92924f31 100644 --- a/target/linux/bcm53xx/base-files/etc/board.d/01_leds +++ b/target/linux/bcm53xx/base-files/etc/board.d/01_leds @@ -4,6 +4,18 @@ board_config_update case "$(board_name)" in +meraki,mx64|\ +meraki,mx64-a0) + ucidef_set_led_netdev "wan" "WAN Port" "green:activity-9" "wan" + ucidef_set_led_netdev "lan1" "LAN Port 1" "green:activity-1" "lan1" + ucidef_set_led_netdev "lan2" "LAN Port 2" "green:activity-3" "lan2" + ucidef_set_led_netdev "lan3" "LAN Port 3" "green:activity-5" "lan3" + ucidef_set_led_netdev "lan4" "LAN Port 4" "green:activity-7" "lan4" + ;; +meraki,mx65) + ucidef_set_led_netdev "wan1" "WAN Port 1" "green:activity-1" "wan1" + ucidef_set_led_netdev "wan2" "WAN Port 2" "green:activity-3" "wan2" + ;; netgear,r8000) ucidef_set_led_usbport "usb2" "USB 2.0" "bcm53xx:white:usb2" "usb1-port2" "usb2-port2" ucidef_set_led_usbport "usb3" "USB 3.0" "bcm53xx:white:usb3" "usb1-port1" "usb2-port1" "usb4-port1" diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network index 6d84442da4..19569e7a78 100644 --- a/target/linux/bcm53xx/base-files/etc/board.d/02_network +++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network @@ -29,6 +29,14 @@ bcm53xx_setup_interfaces() meraki,mr32) ucidef_set_interface_lan "poe" "dhcp" ;; + meraki,mx64 | \ + meraki,mx64-a0) + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" + ;; + meraki,mx65) + ucidef_set_interfaces_lan_wan \ + "lan3 lan4 lan5 lan6 lan7 lan8 lan9 lan10 lan11 lan12" "wan1 wan2" + ;; phicomm,k3) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; @@ -68,6 +76,12 @@ bcm53xx_setup_macs() ucidef_set_interface_macaddr "lan" "$label_mac" ucidef_set_label_macaddr "$label_mac" ;; + meraki,mx64 | \ + meraki,mx64-a0 | \ + meraki,mx65) + etXmacaddr=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) + offset=1 + ;; *) etXmacaddr=$(nvram get et0macaddr) offset=1 diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 645688ac7c..dfa333af8b 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -200,7 +200,10 @@ platform_check_image() { board="$(board_name)" case "$board" in meraki,mr26 | \ - meraki,mr32) + meraki,mr32 | \ + meraki,mx64 | \ + meraki,mx64-a0 | \ + meraki,mx65) # NAND sysupgrade return 0 ;; @@ -403,6 +406,12 @@ platform_do_upgrade() { CI_KERNPART="part.safe" nand_do_upgrade "$1" ;; + meraki,mx64 | \ + meraki,mx64-a0 | \ + meraki,mx65) + REQUIRE_IMAGE_METADATA=1 + nand_do_upgrade "$1" + ;; *) platform_other_do_upgrade "$1" ;; diff --git a/target/linux/bcm53xx/config-6.6 b/target/linux/bcm53xx/config-6.6 index 101bde807f..ace9e7d615 100644 --- a/target/linux/bcm53xx/config-6.6 +++ b/target/linux/bcm53xx/config-6.6 @@ -4,6 +4,7 @@ CONFIG_ARCH_BCM=y CONFIG_ARCH_BCM_5301X=y CONFIG_ARCH_BCM_53573=y CONFIG_ARCH_BCM_IPROC=y +CONFIG_ARCH_BCM_NSP=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_KEEP_MEMBLOCK=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y @@ -34,13 +35,16 @@ CONFIG_ARM_L1_CACHE_SHIFT=6 CONFIG_ARM_L1_CACHE_SHIFT_6=y CONFIG_ARM_PATCH_IDIV=y CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_SP805_WATCHDOG=y CONFIG_ARM_THUMB=y +CONFIG_ARM_TIMER_SP804=y CONFIG_ARM_UNWIND=y CONFIG_ARM_VIRT_EXT=y CONFIG_ATAGS=y CONFIG_AUTO_ZRELADDR=y CONFIG_B53=y CONFIG_B53_MDIO_DRIVER=y +CONFIG_B53_SERDES=y CONFIG_B53_SRAB_DRIVER=y CONFIG_BCM47XX_NVRAM=y CONFIG_BCM47XX_SPROM=y @@ -62,7 +66,7 @@ CONFIG_BCM_NS_THERMAL=y CONFIG_BCM_SR_THERMAL=y CONFIG_BGMAC=y CONFIG_BGMAC_BCMA=y -# CONFIG_BGMAC_PLATFORM is not set +CONFIG_BGMAC_PLATFORM=y CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y @@ -289,9 +293,11 @@ CONFIG_PHY_BCM_SR_USB=y # CONFIG_PHY_BRCM_SATA is not set # CONFIG_PHY_NS2_USB_DRD is not set CONFIG_PINCTRL=y -# CONFIG_PINCTRL_IPROC_GPIO is not set +CONFIG_PINCTRL_IPROC_GPIO=y CONFIG_PINCTRL_NS=y # CONFIG_PINCTRL_NS2_MUX is not set +CONFIG_PINCTRL_NSP_GPIO=y +CONFIG_PINCTRL_NSP_MUX=y CONFIG_PREEMPT_NONE_BUILD=y CONFIG_PTP_1588_CLOCK_OPTIONAL=y CONFIG_PWM=y diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile index 8318450293..ce61ffa468 100644 --- a/target/linux/bcm53xx/image/Makefile +++ b/target/linux/bcm53xx/image/Makefile @@ -420,6 +420,44 @@ define Device/meraki_mr32 endef TARGET_DEVICES += meraki_mr32 +define Device/meraki_mx6x + KERNEL_IN_UBI := 1 + KERNEL_LOADADDR := 0x60008000 + DEVICE_PACKAGES := -oseama kmod-leds-pwm kmod-usb-ehci \ + kmod-usb-ohci kmod-usb2 \ + kmod-ledtrig-default-on kmod-ledtrig-netdev + DEVICE_VENDOR := Cisco Meraki + KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb + KERNEL_INITRAMFS_SUFFIX := .bin + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef + +define Device/meraki_mx64 + $(call Device/meraki_mx6x) + DEVICE_MODEL := MX64 + DEVICE_DTS_CONFIG := config@4 + DEVICE_DTS := bcm958625-meraki-mx64 +endef +TARGET_DEVICES += meraki_mx64 + +define Device/meraki_mx64_a0 + $(call Device/meraki_mx64) + DEVICE_VARIANT := A0 + DEVICE_DTS_CONFIG := config@2 + DEVICE_DTS := bcm958625-meraki-mx64-a0 +endef +TARGET_DEVICES += meraki_mx64_a0 + +define Device/meraki_mx65 + $(call Device/meraki_mx6x) + DEVICE_MODEL := MX65 + DEVICE_DTS_CONFIG := config@3 + DEVICE_DTS := bcm958625-meraki-mx65 +endef +TARGET_DEVICES += meraki_mx65 + define Device/netgear DEVICE_VENDOR := NETGEAR IMAGES := chk diff --git a/target/linux/bcm53xx/patches-6.6/332-Meraki-MX6X-partition-fixups.patch b/target/linux/bcm53xx/patches-6.6/332-Meraki-MX6X-partition-fixups.patch new file mode 100644 index 0000000000..9743c99f28 --- /dev/null +++ b/target/linux/bcm53xx/patches-6.6/332-Meraki-MX6X-partition-fixups.patch @@ -0,0 +1,52 @@ +From 35bba88e75311242841dde83073c211310ec0259 Mon Sep 17 00:00:00 2001 +From: Matthew Hagan +Date: Wed, 4 May 2022 08:07:06 +0100 +Subject: [PATCH] bcm53xx: partition fixups for Meraki MX64/MX65 + +We need to enlarge the u-boot partition to add extra features like UBI +booting. The shmoo and newly created env partitions can easily be moved +to the nvram partition. This fixup allows u-boot to be enlarged to up to +1MiB. + +Signed-off-by: Matthew Hagan +--- + arch/arm/boot/dts/broadcom/bcm958625-meraki-mx6x-common.dtsi | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +--- a/arch/arm/boot/dts/broadcom/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/broadcom/bcm958625-meraki-mx6x-common.dtsi +@@ -84,13 +84,7 @@ + + partition@0 { + label = "u-boot"; +- reg = <0x0 0x80000>; +- read-only; +- }; +- +- partition@80000 { +- label = "shmoo"; +- reg = <0x80000 0x80000>; ++ reg = <0x0 0x100000>; + read-only; + }; + +@@ -101,7 +95,18 @@ + + partition@400000 { + label = "nvram"; +- reg = <0x400000 0x100000>; ++ reg = <0x400000 0x40000>; ++ }; ++ ++ partition@440000 { ++ label = "u-boot-env"; ++ reg = <0x440000 0x40000>; ++ }; ++ ++ partition@480000 { ++ label = "shmoo"; ++ reg = <0x480000 0x80000>; ++ read-only; + }; + + partition@500000 { diff --git a/target/linux/bcm53xx/patches-6.6/333-bcm53xx-dts-meraki-mx6x-add-OpenWrt-specific-LED-ali.patch b/target/linux/bcm53xx/patches-6.6/333-bcm53xx-dts-meraki-mx6x-add-OpenWrt-specific-LED-ali.patch new file mode 100644 index 0000000000..950e85be9c --- /dev/null +++ b/target/linux/bcm53xx/patches-6.6/333-bcm53xx-dts-meraki-mx6x-add-OpenWrt-specific-LED-ali.patch @@ -0,0 +1,83 @@ +From 9f4e68261b89df87457f46999c471d11754b5de2 Mon Sep 17 00:00:00 2001 +From: Lech Perczak +Date: Sun, 6 Oct 2024 15:57:44 +0200 +Subject: [PATCH] bcm53xx: dts: meraki-mx6x: add OpenWrt-specific LED aliases + +Assign green power LED for "boot", "running", orange for "upgrade" and +red for "failsafe" functions - the same as done for MR33 and MR74. + +Signed-off-by: Lech Perczak +--- + arch/arm/boot/dts/broadcom/bcm958625-meraki-alamo.dtsi | 9 ++++++++- + arch/arm/boot/dts/broadcom/bcm958625-meraki-kingpin.dtsi | 8 +++++++- + .../boot/dts/broadcom/bcm958625-meraki-mx6x-common.dtsi | 4 ++-- + 3 files changed, 17 insertions(+), 4 deletions(-) + +--- a/arch/arm/boot/dts/broadcom/bcm958625-meraki-alamo.dtsi ++++ b/arch/arm/boot/dts/broadcom/bcm958625-meraki-alamo.dtsi +@@ -8,6 +8,13 @@ + #include "bcm958625-meraki-mx6x-common.dtsi" + + / { ++ aliases { ++ led-boot = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_fault; ++ led-failsafe = &led_failsafe; ++ }; ++ + keys { + compatible = "gpio-keys-polled"; + autorepeat; +@@ -55,7 +62,7 @@ + gpios = <&gpioa 26 GPIO_ACTIVE_LOW>; + }; + +- led-4 { ++ led_fault: led-4 { + /* amber:power */ + function = LED_FUNCTION_FAULT; + color = ; +--- a/arch/arm/boot/dts/broadcom/bcm958625-meraki-kingpin.dtsi ++++ b/arch/arm/boot/dts/broadcom/bcm958625-meraki-kingpin.dtsi +@@ -8,6 +8,12 @@ + #include "bcm958625-meraki-mx6x-common.dtsi" + + / { ++ aliases { ++ led-boot = &led_power; ++ led-running = &led_power; ++ led-upgrade = &led_fault; ++ led-failsafe = &led_failsafe; ++ }; + + keys { + compatible = "gpio-keys-polled"; +@@ -104,7 +110,7 @@ + gpios = <&gpioa 29 GPIO_ACTIVE_LOW>; + }; + +- led-a { ++ led_fault: led-a { + /* amber:power */ + function = LED_FUNCTION_FAULT; + color = ; +--- a/arch/arm/boot/dts/broadcom/bcm958625-meraki-mx6x-common.dtsi ++++ b/arch/arm/boot/dts/broadcom/bcm958625-meraki-mx6x-common.dtsi +@@ -14,14 +14,14 @@ + pwm-leds { + compatible = "pwm-leds"; + +- led-1 { ++ led_failsafe: led-1 { + function = LED_FUNCTION_INDICATOR; + color = ; + pwms = <&pwm 1 50000>; + max-brightness = <255>; + }; + +- led-2 { ++ led_power: led-2 { + function = LED_FUNCTION_POWER; + color = ; + pwms = <&pwm 2 50000>;