[OpenWrt-Devel] [PATCH] brcm63xx: add Comtrend VR-3032u support

Álvaro Fernández Rojas noltari at gmail.com
Mon Mar 16 12:27:27 EDT 2015


Ignore this patches, wrong selected terminal tab :$.

Regards,
Álvaro.

El 16/03/2015 a las 17:24, Álvaro Fernández Rojas escribió:
> - Avoid bin image generation (only initramfs)
> - NAND/WiFi not working
> 
> Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
> ---
>  target/linux/brcm63xx/base-files/etc/diag.sh       |   3 +
>  .../base-files/etc/uci-defaults/02_network         |   3 +-
>  target/linux/brcm63xx/base-files/lib/brcm63xx.sh   |   3 +
>  target/linux/brcm63xx/dts/vr-3032u.dts             | 142 +++++++++++++++++++++
>  target/linux/brcm63xx/image/Makefile               |   6 +
>  .../brcm63xx/patches-3.18/569-board_VR-3032u.patch |  65 ++++++++++
>  target/linux/brcm63xx/profiles/comtrend.mk         |   9 ++
>  7 files changed, 230 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/brcm63xx/dts/vr-3032u.dts
>  create mode 100644 target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch
> 
> diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh
> index 928c02b..3d6531a 100644
> --- a/target/linux/brcm63xx/base-files/etc/diag.sh
> +++ b/target/linux/brcm63xx/base-files/etc/diag.sh
> @@ -39,6 +39,9 @@ set_state() {
>  	vr-3025u)
>  		status_led="VR-3025u:green:power"
>  		;;
> +	vr-3032u)
> +		status_led="VR-3032u:green:power"
> +		;;
>  	wap-5813n)
>  		status_led="WAP-5813n:green:power"
>  		;;
> diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
> index df4e293..f320d4d 100644
> --- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
> +++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
> @@ -93,7 +93,8 @@ fast2504n |\
>  fast2704v2 |\
>  p870hw-51a_v2 |\
>  vr-3025un |\
> -vr-3025u)
> +vr-3025u |\
> +vr-3032u)
>  	ucidef_set_interface_lan "eth0.1"
>  	ucidef_add_switch "eth0" "1" "1"
>  	ucidef_add_switch_vlan "eth0" "1" "0 1 2 3 8t"
> diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
> index 2c18762..b64cb9e 100755
> --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
> +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
> @@ -84,6 +84,9 @@ brcm63xx_dt_detect() {
>  	"Comtrend VR-3025un")
>  		board_name="vr-3025un"
>  		;;
> +	"Comtrend VR-3032u")
> +		board_name="vr-3032u"
> +		;;
>  	"Comtrend WAP-5813n")
>  		board_name="wap-5813n"
>  		;;
> diff --git a/target/linux/brcm63xx/dts/vr-3032u.dts b/target/linux/brcm63xx/dts/vr-3032u.dts
> new file mode 100644
> index 0000000..0d56394
> --- /dev/null
> +++ b/target/linux/brcm63xx/dts/vr-3032u.dts
> @@ -0,0 +1,142 @@
> +/dts-v1/;
> +
> +/include/ "bcm63268.dtsi"
> +
> +/ {
> +	model = "Comtrend VR-3032u";
> +	compatible = "comtrend,vr-3032u", "brcm,bcm63268";
> +
> +	gpio-keys-polled {
> +		compatible = "gpio-keys-polled";
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +		poll-interval = <20>;
> +		debounce-interval = <60>;
> +
> +		reset {
> +			label = "reset";
> +			gpios = <&gpio1 0 1>;
> +			linux,code = <0x198>;
> +		};
> +		wps {
> +			label = "wps";
> +			gpios = <&gpio1 1 1>;
> +			linux,code = <0x211>;
> +		};
> +	};
> +};
> +
> +&leds0 {
> +	status = "ok";
> +	brcm,serial-leds;
> +
> +	hw_gphy_spd0 {
> +		compatible = "bcm6328-hw-led";
> +		reg = <0>;
> +		act-low = <16>;
> +		label = "gphy-spd0";
> +	};
> +	hw_gphy_spd1 {
> +		compatible = "bcm6328-hw-led";
> +		reg = <1>;
> +		act-low = <20>;
> +		label = "gphy-spd1";
> +	};
> +	hw_ephy0_act {
> +		compatible = "bcm6328-hw-led";
> +		reg = <9>;
> +		label = "ephy0-act";
> +	};
> +	hw_ephy1_act {
> +		compatible = "bcm6328-hw-led";
> +		reg = <10>;
> +		label = "ephy1-act";
> +	};
> +	hw_ephy2_act {
> +		compatible = "bcm6328-hw-led";
> +		reg = <11>;
> +		label = "ephy2-act";
> +	};
> +	hw_gphy0_act {
> +		compatible = "bcm6328-hw-led";
> +		reg = <12>;
> +		label = "gphy0-act";
> +	};
> +	hw_ephy0_spd {
> +		compatible = "bcm6328-hw-led";
> +		reg = <13>;
> +		label = "ephy0-spd";
> +	};
> +	hw_ephy1_spd {
> +		compatible = "bcm6328-hw-led";
> +		reg = <14>;
> +		label = "ephy1-spd";
> +	};
> +	hw_ephy2_spd {
> +		compatible = "bcm6328-hw-led";
> +		reg = <15>;
> +		label = "ephy2-spd";
> +	};
> +
> +	inet_red {
> +		compatible = "bcm6328-led";
> +		reg = <2>;
> +		active-low;
> +		label = "VR-3032u:red:inet";
> +	};
> +	dsl_green {
> +		compatible = "bcm6328-led";
> +		reg = <3>;
> +		active-low;
> +		label = "VR-3032u:green:dsl";
> +	};
> +	usb_green {
> +		compatible = "bcm6328-led";
> +		reg = <4>;
> +		active-low;
> +		label = "VR-3032u:green:usb";
> +	};
> +	wps_green {
> +		compatible = "bcm6328-led";
> +		reg = <7>;
> +		active-low;
> +		label = "VR-3032u:green:wps";
> +	};
> +	inet_green {
> +		compatible = "bcm6328-led";
> +		reg = <8>;
> +		active-low;
> +		label = "VR-3032u:green:inet";
> +	};
> +	lan2_green {
> +		compatible = "bcm6328-led";
> +		reg = <9>;
> +		active-low;
> +		label = "VR-3032u:green:lan2";
> +	};
> +	lan3_green {
> +		compatible = "bcm6328-led";
> +		reg = <10>;
> +		active-low;
> +		label = "VR-3032u:green:lan3";
> +	};
> +	lan4_green {
> +		compatible = "bcm6328-led";
> +		reg = <11>;
> +		active-low;
> +		label = "VR-3032u:green:lan4";
> +	};
> +	lan1_green {
> +		compatible = "bcm6328-led";
> +		reg = <12>;
> +		active-low;
> +		label = "VR-3032u:green:lan1";
> +	};
> +	power_green {
> +		compatible = "bcm6328-led";
> +		reg = <20>;
> +		active-low;
> +		label = "VR-3032u:green:power";
> +		default-state = "on";
> +	};
> +};
> diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
> index 3fb9b1c..afa2ec7 100755
> --- a/target/linux/brcm63xx/image/Makefile
> +++ b/target/linux/brcm63xx/image/Makefile
> @@ -59,6 +59,10 @@ define Image/Build/CFEDTB
>  		--info2 $(1) $(6)
>  endef
>  
> +define Image/Build/NANDCFEDTB
> +	# NAND images not supported, only initramfs
> +endef
> +
>  define Image/Build/OLDCFEDTB
>  	# Generate the tagged image
>  	$(TOPDIR)/scripts/brcmImage.pl -t -p \
> @@ -274,6 +278,8 @@ $(eval $(call ImageDTB,CFEDTB,CT6373,CT-6373,ct-6373,CT6373-1,6358))
>  $(eval $(call ImageDTB,CFEDTB,VR3025u,VR-3025u,vr-3025u,96368M-1541N,6368,--pad 16 --image-offset 0x20000 --block-size 0x20000))
>  # Comtrend VR-3025un
>  $(eval $(call ImageDTB,CFEDTB,VR3025un,VR-3025un,vr-3025un,96368M-1341N,6368,--pad 4))
> +# Comtrend VR-3032u
> +$(eval $(call ImageDTB,NANDCFEDTB,VR3032u,VR-3032u,vr-3032u,963168M-1841N1,63268))
>  # Comtrend WAP-5813n
>  $(eval $(call ImageDTB,CFEDTB,WAP5813n,WAP-5813n,wap-5813n,96369R-1231N,6368,--pad 4))
>  # D-Link DSL-2640B, rev B2
> diff --git a/target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch b/target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch
> new file mode 100644
> index 0000000..9529921
> --- /dev/null
> +++ b/target/linux/brcm63xx/patches-3.18/569-board_VR-3032u.patch
> @@ -0,0 +1,65 @@
> +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
> ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
> +@@ -2578,6 +2578,46 @@ static struct board_info __initdata boar
> + 	},
> + };
> + 
> ++static struct board_info __initdata board_VR3032u = {
> ++	.name				= "963168M-1841N1",
> ++	.expected_cpu_id		= 0x63268,
> ++
> ++	.has_uart0			= 1,
> ++
> ++	.has_ehci0			= 1,
> ++	.has_ohci0			= 1,
> ++	.num_usbh_ports			= 1,
> ++
> ++	.has_enetsw			= 1,
> ++	.enetsw = {
> ++		.used_ports = {
> ++			[0] = {
> ++				.used	= 1,
> ++				.phy_id	= 1,
> ++				.name	= "LAN2",
> ++			},
> ++
> ++			[1] = {
> ++				.used	= 1,
> ++				.phy_id	= 2,
> ++				.name	= "LAN3",
> ++			},
> ++
> ++			[2] = {
> ++				.used	= 1,
> ++				.phy_id	= 3,
> ++				.name	= "LAN4",
> ++			},
> ++
> ++			[3] = {
> ++				.used	= 1,
> ++				.phy_id	= 4,
> ++				.name	= "LAN1",
> ++			},
> ++		},
> ++	},
> ++};
> ++
> + static struct board_info __initdata board_vw6339gu = {
> + 	.name				= "VW6339GU",
> + 	.expected_cpu_id		= 0x63268,
> +@@ -2774,6 +2814,7 @@ static const struct board_info __initcon
> + #ifdef CONFIG_BCM63XX_CPU_63268
> + 	&board_963268bu_p300,
> + 	&board_963269bhr,
> ++	&board_VR3032u,
> + 	&board_vw6339gu,
> + #endif
> + };
> +@@ -2861,6 +2902,7 @@ static struct of_device_id const bcm963x
> + #endif
> + #ifdef CONFIG_BCM63XX_CPU_63268
> + 	{ .compatible = "brcm,bcm963268bu_p300", .data = &board_963268bu_p300, },
> ++	{ .compatible = "comtrend,vr-3032u", .data = &board_VR3032u, },
> + #endif
> + #endif /* CONFIG_OF */
> + 	{ },
> diff --git a/target/linux/brcm63xx/profiles/comtrend.mk b/target/linux/brcm63xx/profiles/comtrend.mk
> index 8c1b862..4145899 100644
> --- a/target/linux/brcm63xx/profiles/comtrend.mk
> +++ b/target/linux/brcm63xx/profiles/comtrend.mk
> @@ -73,6 +73,15 @@ define Profile/VR3025un/Description
>  endef
>  $(eval $(call Profile,VR3025un))
>  
> +define Profile/VR3032u
> +  NAME:=Comtrend VR-3032u
> +  PACKAGES:=kmod-usb2 kmod-usb-ohci
> +endef
> +define Profile/VR3032u/Description
> +  Package set optimized for VR-3032u.
> +endef
> +$(eval $(call Profile,VR3032u))
> +
>  define Profile/WAP5813n
>    NAME:=Comtrend WAP-5813n
>    PACKAGES:=kmod-b43 wpad-mini \
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list