[OpenWrt-Devel] [PATCH][bcm63xx]: Add DGND3700 v1 / DGND3800B support

dani dgcbueu at gmail.com
Fri Feb 20 07:08:44 EST 2015


This adds support for the Netgear DGND3700 v1 and DGND3800B. 

DGND3700 v1 and DGND3800B are exactly the same router, only one difference,
the factory firmware. This patch produces two factory firmwares for each router. 
The miniPCI card have two radios, I included sprom fixups bor both spite wifi works
ok without it.

The router includes an onboard NAND flash for extra storage. NAND is currently
not supported in bcm63xx, so no code added for this part. The NOR flash (32MB)
is enough for storing an openwrt firmware.

Signed-off-by: Daniel Gonzalez <dgcbueu at gmail.com>
diff --git a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
index 854b3b2..69d797e 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/01_leds
@@ -14,6 +14,14 @@ case "$board_name" in
 96328dg2x2)
 	ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1"
 	;;
+DGND3700v1_3800B)
+	ucidef_set_led_netdev "lan" "LAN" "DGND3700v1_3800B:green:lan" "eth0.1"
+	ucidef_set_led_netdev "wan" "WAN" "DGND3700v1_3800B:green:inet" "eth0.2"
+	ucidef_set_led_netdev "wlan0" "WIFI2G" "DGND3700v1_3800B:green:wifi2g" "wlan0"
+	ucidef_set_led_netdev "wlan1" "WIFI5G" "DGND3700v1_3800B:blue:wifi5g" "wlan1"
+	ucidef_set_led_usbdev "usb1" "USB1" "DGND3700v1_3800B:green:usb-back" "1-1"
+	ucidef_set_led_usbdev "usb2" "USB2" "DGND3700v1_3800B:green:usb-front" "1-2"
+	;;
 'F at ST2704V2')
 	ucidef_set_led_usbdev "usb" "USB" "F at ST2704V2:green:usb" "1-1"
 	;;
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 709a1c8..6b9736a 100644
--- a/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
+++ b/target/linux/brcm63xx/base-files/etc/uci-defaults/02_network
@@ -108,6 +108,13 @@ P870HW-51a_v2)
 	ucidef_add_switch_vlan "eth0" "2" "4 5t"
 	;;
 
+DGND3700v1_3800B)
+	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
+	ucidef_add_switch "eth0" "1" "1"
+	ucidef_add_switch_vlan "eth0" "1" "1 2 3 4 8t"
+	ucidef_add_switch_vlan "eth0" "2" "0 8t"
+	;;
+
 NB6)
 	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
 	ucidef_add_switch "switch0" "1" "1"
diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
index 58ce71e..53dd759 100755
--- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
+++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh
@@ -111,6 +111,13 @@ brcm63xx_detect() {
 		brcm63xx_has_reset_button="true"
 		ifname=eth0
 		;;
+
+	DGND3700v1_3800B)
+		status_led="DGND3700v1_3800B:green:power"
+		brcm63xx_has_reset_button="true"
+		ifname="eth0"
+		;;
+
 	"F at ST2504n")
 		status_led="fast2504n:green:ok"
 		brcm63xx_has_reset_button="true"
diff --git a/target/linux/brcm63xx/image/Makefile b/target/linux/brcm63xx/image/Makefile
index fd1e157..4520f06 100755
--- a/target/linux/brcm63xx/image/Makefile
+++ b/target/linux/brcm63xx/image/Makefile
@@ -105,6 +105,11 @@ define Image/Build/HCS
 		--output_file=$(BIN_DIR)/openwrt-$(2)-$(1).bin
 endef
 
+define Image/Build/Chk
+	$(STAGING_DIR_HOST)/bin/mkchkimg -o $(BIN_DIR)/openwrt-$(5)-$(1)-factory.chk \
+	-k $(BIN_DIR)/openwrt-$(2)-$(1)-cfe.bin -b $(3) -r $(4)
+endef
+
 define Build/Clean
 	$(MAKE) -C lzma-loader clean
 endef
@@ -209,6 +214,11 @@ define Image/Build
 	# build dtb image list
 	$(foreach image,$(TARGET_$(PROFILE)_IMAGES),$(call Image/Build/$(image),$(1)))
 
+	#Netgear DGND3700 v1 factory firmware
+	$(call Image/Build/Chk,$(1),DGND3700v1_3800B,U12L144T01_NETGEAR_NEWLED,1,DGND3700v1)
+	#Netgear DGND3800B factory firmware
+	$(call Image/Build/Chk,$(1),DGND3700v1_3800B,U12L144T11_NETGEAR_NEWLED,1,DGND3800B)
+
   ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
 	$(call Image/Build/Initramfs)
   endif
@@ -298,6 +308,8 @@ $(eval $(call ImageDTB,CFEDTB,HG556a_AB,hg556a-b,HW556,6358,HG556a_B,--rsa-signa
 $(eval $(call ImageDTB,CFEDTB,HG556a_C,hg556a-c,HW556,6358,HG556a_C,--rsa-signature "EchoLife_HG556a" --image-offset 0x20000 --block-size 0x20000 --tag-version 8))
 # Netgear DG834GT/PN
 $(eval $(call ImageDTB,CFEDTB,DG834GTPN,dg834gtpn,96348GW-10,6348,DG834GT_PN))
+# Netgear DGND3700 v1 / DGND3800B
+$(eval $(call ImageDTB,CFEDTB,DGND3700v1_3800B,dgnd3700v1,96368MVWG,6368,DGND3700v1_3800B,--image-offset 0x20000 --block-size 0x20000))
 # Pirelli Alice Gate VoIP 2 Plus Wi-Fi AGPF-S0
 $(eval $(call ImageDTB,CFEDTB,AGPF_S0,agpf-s0,AGPF-S0,6358,AGV2+W,--block-size 0x20000 --image-offset 0x20000 --signature2 IMAGE --tag-version 8))
 # Pirelli A226G
diff --git a/target/linux/brcm63xx/profiles/netgear.mk b/target/linux/brcm63xx/profiles/netgear.mk
index 562e0f5..a731b36 100644
--- a/target/linux/brcm63xx/profiles/netgear.mk
+++ b/target/linux/brcm63xx/profiles/netgear.mk
@@ -13,3 +13,13 @@ define Profile/DG834GTPN/Description
   Package set optimized for DG834GT/PN.
 endef
 $(eval $(call Profile,DG834GTPN))
+
+define Profile/DGND3700v1_3800B
+  NAME:=Netgear DGND3700 v1 / DGND3800B
+  PACKAGES:=kmod-b43 wpad-mini \
+	kmod-usb2 kmod-usb-ohci kmod-ledtrig-usbdev
+endef
+define Profile/DGND3700v1_3800B/Description
+  Package set optimized for DGND3700 v1 / DGND3800B.
+endef
+$(eval $(call Profile,DGND3700v1_3800B))
diff --git a/target/linux/brcm63xx/dts/dgnd3700v1.dts b/target/linux/brcm63xx/dts/dgnd3700v1.dts
new file mode 100644
index 0000000..a647476
--- /dev/null
+++ b/target/linux/brcm63xx/dts/dgnd3700v1.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+
+/include/ "bcm6368.dtsi"
+
+/ {
+	model = "Netgear DGND3700v1/DGND3800B";
+	compatible = "netgear,dgnd3700v1", "brcm,bcm6368";
+};
+
+&pflash {
+	status = "ok";
+
+	linux,part-probe = "bcm63xxpart";
+
+	cfe at 0 {
+		label = "CFE";
+		reg = <0x000000 0x020000>;
+		read-only;
+	};
+
+	linux at 20000 {
+		label = "linux";
+		reg = <0x020000 0x1e20000>;
+	};
+
+	netgear_parts at 1e40000 {
+		label = "netgear_parts";
+		reg = <0x1e40000 0x1a0000>;
+		read-only;
+	};
+	
+	nvram at 1fe0000 {
+		label = "nvram";
+		reg = <0x1fe0000 0x20000>;
+	};
+};
diff --git a/target/linux/brcm63xx/patches-3.14/568-board_DGND3700v1_3800B.patch b/target/linux/brcm63xx/patches-3.14/568-board_DGND3700v1_3800B.patch
new file mode 100644
index 0000000..11af8f2
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.14/568-board_DGND3700v1_3800B.patch
@@ -0,0 +1,289 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -4419,6 +4419,270 @@
+ 	.has_ehci0 = 1,
+ };
+ 
++static struct sprom_fixup __initdata dgnd3700v1BG_fixups[] = {
++	{ .offset = 65, .value = 0x1302 },
++	{ .offset = 68, .value = 0x3402 },
++	{ .offset = 96, .value = 0x204e },
++	{ .offset = 97, .value = 0xfeb1 },
++	{ .offset = 98, .value = 0x171b },
++	{ .offset = 99, .value = 0xfa7f },
++	{ .offset = 100, .value = 0x3e46 },
++	{ .offset = 101, .value = 0x4646 },
++	{ .offset = 112, .value = 0x204e },
++	{ .offset = 113, .value = 0xfea9 },
++	{ .offset = 114, .value = 0x1650 },
++	{ .offset = 115, .value = 0xfaab },
++	{ .offset = 116, .value = 0x3e46 },
++	{ .offset = 117, .value = 0x4646 },
++	{ .offset = 161, .value = 0x0000 },
++	{ .offset = 162, .value = 0x6422 },
++	{ .offset = 164, .value = 0x6420 },
++	{ .offset = 166, .value = 0x6420 },
++	{ .offset = 168, .value = 0x6420 },
++	{ .offset = 169, .value = 0x0000 },
++	{ .offset = 170, .value = 0x6422 },
++	{ .offset = 171, .value = 0x2222 },
++	{ .offset = 172, .value = 0x8644 },
++	{ .offset = 173, .value = 0x5555 },
++	{ .offset = 174, .value = 0x8655 },
++	{ .offset = 175, .value = 0x5555 },
++	{ .offset = 176, .value = 0xa866 },
++	{ .offset = 178, .value = 0x6420 },
++	{ .offset = 180, .value = 0x6420 },
++	{ .offset = 182, .value = 0x7420 },
++	{ .offset = 184, .value = 0x8642 },
++	{ .offset = 186, .value = 0x6420 },
++	{ .offset = 188, .value = 0x6420 },
++	{ .offset = 190, .value = 0x7420 },
++	{ .offset = 192, .value = 0x8642 },
++	{ .offset = 193, .value = 0x2222 },
++	{ .offset = 194, .value = 0x6420 },
++	{ .offset = 195, .value = 0x2222 },
++	{ .offset = 196, .value = 0x7420 },
++	{ .offset = 197, .value = 0x2222 },
++	{ .offset = 198, .value = 0x7420 },
++	{ .offset = 199, .value = 0x2222 },
++	{ .offset = 200, .value = 0x8642 },
++	{ .offset = 203, .value = 0x0000 },
++	{ .offset = 219, .value = 0xfd08 },
++};
++static struct sprom_fixup __initdata dgnd3700v1ABG_fixups[] = {
++	{ .offset = 2, .value = 0x04d2 },
++	{ .offset = 4, .value = 0x4350 },
++	{ .offset = 65, .value = 0x1311 },
++	{ .offset = 68, .value = 0x0000 },
++	{ .offset = 78, .value = 0x0303 },
++	{ .offset = 88, .value = 0x0325 },
++	{ .offset = 96, .value = 0x204e },
++	{ .offset = 97, .value = 0xffff },
++	{ .offset = 98, .value = 0xffff },
++	{ .offset = 99, .value = 0xffff },
++	{ .offset = 100, .value = 0x3e46 },
++	{ .offset = 101, .value = 0x4646 },
++	{ .offset = 102, .value = 0xfebc },
++	{ .offset = 103, .value = 0x153b }, 
++	{ .offset = 104, .value = 0xfad2 },
++	{ .offset = 105, .value = 0xfebc },
++	{ .offset = 106, .value = 0x153b },
++	{ .offset = 107, .value = 0xfad2 },
++	{ .offset = 108, .value = 0xfed9 },
++	{ .offset = 109, .value = 0x1552 },
++	{ .offset = 110, .value = 0xfb00 },
++	{ .offset = 111, .value = 0x0000 },
++	{ .offset = 112, .value = 0x204e },
++	{ .offset = 113, .value = 0xffff },
++	{ .offset = 114, .value = 0xffff },
++	{ .offset = 115, .value = 0xffff },
++	{ .offset = 116, .value = 0x3e46 },
++	{ .offset = 117, .value = 0x4646 },
++	{ .offset = 118, .value = 0xfee1 },
++	{ .offset = 119, .value = 0x151d },
++	{ .offset = 120, .value = 0xfafc },
++	{ .offset = 121, .value = 0xfee1 },
++	{ .offset = 122, .value = 0x151d },
++	{ .offset = 123, .value = 0xfafc },
++	{ .offset = 124, .value = 0xfeda },
++	{ .offset = 125, .value = 0x1567 },
++	{ .offset = 126, .value = 0xfaf0 },
++	{ .offset = 127, .value = 0x0000 },
++	{ .offset = 128, .value = 0xfee1 },
++	{ .offset = 129, .value = 0x151d },
++	{ .offset = 161, .value = 0x0000 },
++	{ .offset = 162, .value = 0x6422 },
++	{ .offset = 164, .value = 0x6420 },
++	{ .offset = 166, .value = 0x6420 },
++	{ .offset = 168, .value = 0x6420 },
++	{ .offset = 169, .value = 0x0000 },
++	{ .offset = 170, .value = 0x6422 },
++	{ .offset = 171, .value = 0x2222 },
++	{ .offset = 172, .value = 0x8644 },
++	{ .offset = 173, .value = 0x5555 },
++	{ .offset = 174, .value = 0x8655 },
++	{ .offset = 175, .value = 0x5555 },
++	{ .offset = 176, .value = 0xa866 },
++	{ .offset = 178, .value = 0x6420 },
++	{ .offset = 180, .value = 0x6420 },
++	{ .offset = 182, .value = 0x7420 },
++	{ .offset = 184, .value = 0x8642 },
++	{ .offset = 186, .value = 0x6420 },
++	{ .offset = 188, .value = 0x6420 },
++	{ .offset = 190, .value = 0x7420 },
++	{ .offset = 192, .value = 0x8642 },
++	{ .offset = 193, .value = 0x2222 },
++	{ .offset = 194, .value = 0x6420 },
++	{ .offset = 195, .value = 0x2222 },
++	{ .offset = 196, .value = 0x7420 },
++	{ .offset = 197, .value = 0x2222 },
++	{ .offset = 198, .value = 0x7420 },
++	{ .offset = 199, .value = 0x2222 },
++	{ .offset = 200, .value = 0x8642 },
++	{ .offset = 203, .value = 0x0000 },
++	{ .offset = 219, .value = 0xbe08 },
++};
++
++static struct b53_platform_data DGND3700v1_3800B_b53_pdata = {
++	.alias    = "eth0",
++};
++
++static struct spi_board_info DGND3700v1_3800B_spi_devices[] = {
++	{
++		.modalias = "b53-switch",
++		.max_speed_hz = 781000,
++		.bus_num = 0,
++		.chip_select = 1,
++		.platform_data = &DGND3700v1_3800B_b53_pdata,
++	}
++};
++
++static struct board_info __initdata board_DGND3700v1_3800B = {
++	.name				= "DGND3700v1_3800B",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0			= 1,
++	.has_pci			= 1,
++	.has_ohci0			= 1,
++	.has_ehci0			= 1,
++	.num_usbh_ports			= 2,
++
++	.has_enetsw			= 1,
++	.enetsw = {
++		.used_ports = {
++			[5] = {
++				.used  = 1,
++				.phy_id  = 0xff,
++				.bypass_link = 1,
++				.force_speed = 1000,
++				.force_duplex_full = 1,
++				.name  = "RGMII",
++			},
++		},
++	},
++
++	.leds = {
++		{
++			.name		= "DGND3700v1_3800B:green:dsl",
++			.gpio		= 2,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:red:inet",
++			.gpio		= 4,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:inet",
++			.gpio		= 5,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:wps",
++			.gpio		= 11,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:usb-front",
++			.gpio		= 13,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:usb-back",
++			.gpio		= 14,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:red:power",
++			.gpio		= 22,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:lan",
++			.gpio		= 23,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:power",
++			.gpio		= 24,
++			.active_low	= 1,
++			.default_trigger = "default-on",
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:wifi2g",
++			.gpio		= 26,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:blue:wifi5g",
++			.gpio		= 27,
++			.active_low	= 1,
++		},
++	},
++
++	.buttons = {
++		{
++			.desc			= "wlan",
++			.gpio			= 10,
++			.active_low		= 1,
++			.type			= EV_KEY,
++			.code			= KEY_WLAN,
++			.debounce_interval	= BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++		},
++		{
++			.desc		= "reset",
++			.gpio		= 12,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= KEY_RESTART,
++			.debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++		},
++		{
++			.desc		= "wps",
++			.gpio		= 35,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= KEY_WPS_BUTTON,
++			.debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++		},
++	},
++
++	.spis = DGND3700v1_3800B_spi_devices,
++	.num_spis = ARRAY_SIZE(DGND3700v1_3800B_spi_devices),
++
++	.fallback_sprom = {
++		.type 				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 1,
++		.board_fixups			= dgnd3700v1BG_fixups,
++		.num_board_fixups		= ARRAY_SIZE(dgnd3700v1BG_fixups),
++	},
++	.fallback_sprom = {
++		.type 				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 2,
++		.board_fixups			= dgnd3700v1ABG_fixups,
++		.num_board_fixups		= ARRAY_SIZE(dgnd3700v1ABG_fixups),
++	},
++};
++
+ static struct sprom_fixup __initdata vr3025u_fixups[] = {
+ 	{ .offset = 97, .value = 0xfeb3 },
+ 	{ .offset = 98, .value = 0x1618 },
+@@ -5221,6 +5485,7 @@
+ #ifdef CONFIG_BCM63XX_CPU_6368
+ 	&board_96368mvwg,
+ 	&board_96368mvngr,
++	&board_DGND3700v1_3800B,
+ 	&board_P870HW51A_V2,
+ 	&board_VR3025u,
+ 	&board_VR3025un,
+@@ -5309,6 +5574,7 @@
+ 	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+ 	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
+ 	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
++	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
+ 	{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
diff --git a/target/linux/brcm63xx/patches-3.18/568-board_DGND3700v1_3800B.patch b/target/linux/brcm63xx/patches-3.18/568-board_DGND3700v1_3800B.patch
new file mode 100644
index 0000000..11af8f2
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.18/568-board_DGND3700v1_3800B.patch
@@ -0,0 +1,289 @@
+--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c
++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c
+@@ -4419,6 +4419,270 @@
+ 	.has_ehci0 = 1,
+ };
+ 
++static struct sprom_fixup __initdata dgnd3700v1BG_fixups[] = {
++	{ .offset = 65, .value = 0x1302 },
++	{ .offset = 68, .value = 0x3402 },
++	{ .offset = 96, .value = 0x204e },
++	{ .offset = 97, .value = 0xfeb1 },
++	{ .offset = 98, .value = 0x171b },
++	{ .offset = 99, .value = 0xfa7f },
++	{ .offset = 100, .value = 0x3e46 },
++	{ .offset = 101, .value = 0x4646 },
++	{ .offset = 112, .value = 0x204e },
++	{ .offset = 113, .value = 0xfea9 },
++	{ .offset = 114, .value = 0x1650 },
++	{ .offset = 115, .value = 0xfaab },
++	{ .offset = 116, .value = 0x3e46 },
++	{ .offset = 117, .value = 0x4646 },
++	{ .offset = 161, .value = 0x0000 },
++	{ .offset = 162, .value = 0x6422 },
++	{ .offset = 164, .value = 0x6420 },
++	{ .offset = 166, .value = 0x6420 },
++	{ .offset = 168, .value = 0x6420 },
++	{ .offset = 169, .value = 0x0000 },
++	{ .offset = 170, .value = 0x6422 },
++	{ .offset = 171, .value = 0x2222 },
++	{ .offset = 172, .value = 0x8644 },
++	{ .offset = 173, .value = 0x5555 },
++	{ .offset = 174, .value = 0x8655 },
++	{ .offset = 175, .value = 0x5555 },
++	{ .offset = 176, .value = 0xa866 },
++	{ .offset = 178, .value = 0x6420 },
++	{ .offset = 180, .value = 0x6420 },
++	{ .offset = 182, .value = 0x7420 },
++	{ .offset = 184, .value = 0x8642 },
++	{ .offset = 186, .value = 0x6420 },
++	{ .offset = 188, .value = 0x6420 },
++	{ .offset = 190, .value = 0x7420 },
++	{ .offset = 192, .value = 0x8642 },
++	{ .offset = 193, .value = 0x2222 },
++	{ .offset = 194, .value = 0x6420 },
++	{ .offset = 195, .value = 0x2222 },
++	{ .offset = 196, .value = 0x7420 },
++	{ .offset = 197, .value = 0x2222 },
++	{ .offset = 198, .value = 0x7420 },
++	{ .offset = 199, .value = 0x2222 },
++	{ .offset = 200, .value = 0x8642 },
++	{ .offset = 203, .value = 0x0000 },
++	{ .offset = 219, .value = 0xfd08 },
++};
++static struct sprom_fixup __initdata dgnd3700v1ABG_fixups[] = {
++	{ .offset = 2, .value = 0x04d2 },
++	{ .offset = 4, .value = 0x4350 },
++	{ .offset = 65, .value = 0x1311 },
++	{ .offset = 68, .value = 0x0000 },
++	{ .offset = 78, .value = 0x0303 },
++	{ .offset = 88, .value = 0x0325 },
++	{ .offset = 96, .value = 0x204e },
++	{ .offset = 97, .value = 0xffff },
++	{ .offset = 98, .value = 0xffff },
++	{ .offset = 99, .value = 0xffff },
++	{ .offset = 100, .value = 0x3e46 },
++	{ .offset = 101, .value = 0x4646 },
++	{ .offset = 102, .value = 0xfebc },
++	{ .offset = 103, .value = 0x153b }, 
++	{ .offset = 104, .value = 0xfad2 },
++	{ .offset = 105, .value = 0xfebc },
++	{ .offset = 106, .value = 0x153b },
++	{ .offset = 107, .value = 0xfad2 },
++	{ .offset = 108, .value = 0xfed9 },
++	{ .offset = 109, .value = 0x1552 },
++	{ .offset = 110, .value = 0xfb00 },
++	{ .offset = 111, .value = 0x0000 },
++	{ .offset = 112, .value = 0x204e },
++	{ .offset = 113, .value = 0xffff },
++	{ .offset = 114, .value = 0xffff },
++	{ .offset = 115, .value = 0xffff },
++	{ .offset = 116, .value = 0x3e46 },
++	{ .offset = 117, .value = 0x4646 },
++	{ .offset = 118, .value = 0xfee1 },
++	{ .offset = 119, .value = 0x151d },
++	{ .offset = 120, .value = 0xfafc },
++	{ .offset = 121, .value = 0xfee1 },
++	{ .offset = 122, .value = 0x151d },
++	{ .offset = 123, .value = 0xfafc },
++	{ .offset = 124, .value = 0xfeda },
++	{ .offset = 125, .value = 0x1567 },
++	{ .offset = 126, .value = 0xfaf0 },
++	{ .offset = 127, .value = 0x0000 },
++	{ .offset = 128, .value = 0xfee1 },
++	{ .offset = 129, .value = 0x151d },
++	{ .offset = 161, .value = 0x0000 },
++	{ .offset = 162, .value = 0x6422 },
++	{ .offset = 164, .value = 0x6420 },
++	{ .offset = 166, .value = 0x6420 },
++	{ .offset = 168, .value = 0x6420 },
++	{ .offset = 169, .value = 0x0000 },
++	{ .offset = 170, .value = 0x6422 },
++	{ .offset = 171, .value = 0x2222 },
++	{ .offset = 172, .value = 0x8644 },
++	{ .offset = 173, .value = 0x5555 },
++	{ .offset = 174, .value = 0x8655 },
++	{ .offset = 175, .value = 0x5555 },
++	{ .offset = 176, .value = 0xa866 },
++	{ .offset = 178, .value = 0x6420 },
++	{ .offset = 180, .value = 0x6420 },
++	{ .offset = 182, .value = 0x7420 },
++	{ .offset = 184, .value = 0x8642 },
++	{ .offset = 186, .value = 0x6420 },
++	{ .offset = 188, .value = 0x6420 },
++	{ .offset = 190, .value = 0x7420 },
++	{ .offset = 192, .value = 0x8642 },
++	{ .offset = 193, .value = 0x2222 },
++	{ .offset = 194, .value = 0x6420 },
++	{ .offset = 195, .value = 0x2222 },
++	{ .offset = 196, .value = 0x7420 },
++	{ .offset = 197, .value = 0x2222 },
++	{ .offset = 198, .value = 0x7420 },
++	{ .offset = 199, .value = 0x2222 },
++	{ .offset = 200, .value = 0x8642 },
++	{ .offset = 203, .value = 0x0000 },
++	{ .offset = 219, .value = 0xbe08 },
++};
++
++static struct b53_platform_data DGND3700v1_3800B_b53_pdata = {
++	.alias    = "eth0",
++};
++
++static struct spi_board_info DGND3700v1_3800B_spi_devices[] = {
++	{
++		.modalias = "b53-switch",
++		.max_speed_hz = 781000,
++		.bus_num = 0,
++		.chip_select = 1,
++		.platform_data = &DGND3700v1_3800B_b53_pdata,
++	}
++};
++
++static struct board_info __initdata board_DGND3700v1_3800B = {
++	.name				= "DGND3700v1_3800B",
++	.expected_cpu_id		= 0x6368,
++
++	.has_uart0			= 1,
++	.has_pci			= 1,
++	.has_ohci0			= 1,
++	.has_ehci0			= 1,
++	.num_usbh_ports			= 2,
++
++	.has_enetsw			= 1,
++	.enetsw = {
++		.used_ports = {
++			[5] = {
++				.used  = 1,
++				.phy_id  = 0xff,
++				.bypass_link = 1,
++				.force_speed = 1000,
++				.force_duplex_full = 1,
++				.name  = "RGMII",
++			},
++		},
++	},
++
++	.leds = {
++		{
++			.name		= "DGND3700v1_3800B:green:dsl",
++			.gpio		= 2,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:red:inet",
++			.gpio		= 4,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:inet",
++			.gpio		= 5,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:wps",
++			.gpio		= 11,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:usb-front",
++			.gpio		= 13,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:usb-back",
++			.gpio		= 14,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:red:power",
++			.gpio		= 22,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:lan",
++			.gpio		= 23,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:power",
++			.gpio		= 24,
++			.active_low	= 1,
++			.default_trigger = "default-on",
++		},
++		{
++			.name		= "DGND3700v1_3800B:green:wifi2g",
++			.gpio		= 26,
++			.active_low	= 1,
++		},
++		{
++			.name		= "DGND3700v1_3800B:blue:wifi5g",
++			.gpio		= 27,
++			.active_low	= 1,
++		},
++	},
++
++	.buttons = {
++		{
++			.desc			= "wlan",
++			.gpio			= 10,
++			.active_low		= 1,
++			.type			= EV_KEY,
++			.code			= KEY_WLAN,
++			.debounce_interval	= BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++		},
++		{
++			.desc		= "reset",
++			.gpio		= 12,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= KEY_RESTART,
++			.debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++		},
++		{
++			.desc		= "wps",
++			.gpio		= 35,
++			.active_low	= 1,
++			.type		= EV_KEY,
++			.code		= KEY_WPS_BUTTON,
++			.debounce_interval = BCM963XX_KEYS_DEBOUNCE_INTERVAL,
++		},
++	},
++
++	.spis = DGND3700v1_3800B_spi_devices,
++	.num_spis = ARRAY_SIZE(DGND3700v1_3800B_spi_devices),
++
++	.fallback_sprom = {
++		.type 				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 1,
++		.board_fixups			= dgnd3700v1BG_fixups,
++		.num_board_fixups		= ARRAY_SIZE(dgnd3700v1BG_fixups),
++	},
++	.fallback_sprom = {
++		.type 				= SPROM_BCM43222,
++		.pci_bus			= 0,
++		.pci_dev			= 2,
++		.board_fixups			= dgnd3700v1ABG_fixups,
++		.num_board_fixups		= ARRAY_SIZE(dgnd3700v1ABG_fixups),
++	},
++};
++
+ static struct sprom_fixup __initdata vr3025u_fixups[] = {
+ 	{ .offset = 97, .value = 0xfeb3 },
+ 	{ .offset = 98, .value = 0x1618 },
+@@ -5221,6 +5485,7 @@
+ #ifdef CONFIG_BCM63XX_CPU_6368
+ 	&board_96368mvwg,
+ 	&board_96368mvngr,
++	&board_DGND3700v1_3800B,
+ 	&board_P870HW51A_V2,
+ 	&board_VR3025u,
+ 	&board_VR3025un,
+@@ -5309,6 +5574,7 @@
+ 	{ .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, },
+ 	{ .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, },
+ 	{ .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, },
++	{ .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, },
+ 	{ .compatible = "zyxel,p870hw-51a-v2", .data = &board_P870HW51A_V2, },
+ #endif
+ #ifdef CONFIG_BCM63XX_CPU_63268
_______________________________________________
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