[OpenWrt-Devel] [PATCH] ramips: add support for A5-V11 board

Gareth Bryan gaz at mx9.org
Mon Oct 27 19:28:25 EDT 2014


First time patch/post, have read the submitting patch guide - but apologies if I have made a faux pas somewhere (styling etiquette/etc).
Pointers and/or constructive criticism welcome.

Unbranded. Silkscreen on PCB is “A5-V11”, believed to be made by Bococom (or at least uses Bococom image encryption - as used on poray devices - but different key)

Signed-off-by: Gareth Bryan <gaz at mx9.org>
---
target/linux/ramips/base-files/etc/board.d/01_leds |   3 +
.../linux/ramips/base-files/etc/board.d/02_network |   7 ++
target/linux/ramips/base-files/lib/ramips.sh       |   3 +
.../ramips/base-files/lib/upgrade/platform.sh      |   1 +
target/linux/ramips/dts/A5-V11.dts                 | 117 +++++++++++++++++++++
target/linux/ramips/image/Makefile                 |   3 +
target/linux/ramips/rt305x/profiles/misc.mk        |  18 ++++
tools/firmware-utils/src/mkporayfw.c               |   8 ++
8 files changed, 160 insertions(+)
create mode 100644 target/linux/ramips/dts/A5-V11.dts
create mode 100644 target/linux/ramips/rt305x/profiles/misc.mk

diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds
index 7ca7ffb..4a482b3 100755
--- a/target/linux/ramips/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/base-files/etc/board.d/01_leds
@@ -27,6 +27,9 @@ case $board in
	3g300m)
		set_usb_led "tenda:blue:3g"
		;;
+	a5-v11)
+		ucidef_set_led_default "power" "POWER" "a5-v11:red:power" "1"
+		;;
	air3gii)
		set_wifi_led "airlive:green:wlan"
		set_usb_led "airlive:green:mobile"
diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network
index ff8fbc0..6510b1a 100755
--- a/target/linux/ramips/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/base-files/etc/board.d/02_network
@@ -37,6 +37,12 @@ ramips_setup_interfaces()
	ucidef_set_interface_loopback

	case $board in
+	a5-v11)
+		ucidef_set_interface_lan "eth0.1"
+		ucidef_add_switch "switch0" "1" "1"
+		ucidef_add_switch_vlan "switch0" "1" "0 6t"
+		;;
+
	3g300m | \
	w150m | \
	all0256n | \
@@ -252,6 +258,7 @@ ramips_setup_macs()
		lan_mac=$(macaddr_add "$lan_mac" -2)
		;;

+	a5-v11 |\
	bc2 |\
	broadway |\
	d105 |\
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh
index 88fa623..b2b299d 100755
--- a/target/linux/ramips/base-files/lib/ramips.sh
+++ b/target/linux/ramips/base-files/lib/ramips.sh
@@ -25,6 +25,9 @@ ramips_board_detect() {
	*"Edimax 3g-6200nl")
		name="3g-6200nl"
		;;
+	*"A5-V11")
+		name="a5-v11"
+		;;
	*"Airlink101 AR725W")
		name="ar725w"
		;;
diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh
index c9a418e..4fe0ef4 100755
--- a/target/linux/ramips/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh
@@ -17,6 +17,7 @@ platform_check_image() {
	3g-6200n | \
	3g-6200nl | \
	3g300m | \
+	a5-v11 | \
	air3gii | \
	all0239-3g | \
	all0256n | \
diff --git a/target/linux/ramips/dts/A5-V11.dts b/target/linux/ramips/dts/A5-V11.dts
new file mode 100644
index 0000000..154074a
--- /dev/null
+++ b/target/linux/ramips/dts/A5-V11.dts
@@ -0,0 +1,117 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+	compatible = "A5-V11", "ralink,rt5350-soc";
+	model = "A5-V11";
+
+	palmbus at 10000000 {
+		spi at b00 {
+			status = "okay";
+			m25p80 at 0 {
+				#address-cells = <1>;
+				#size-cells = <1>;
+				compatible = "pm25lq032";
+				reg = <0 0>;
+				linux,modalias = "m25p80", "pm25lq032";
+				spi-max-frequency = <10000000>;
+
+				partition at 0 {
+					label = "u-boot";
+					reg = <0x0 0x30000>;
+					read-only;
+				};
+
+				partition at 30000 {
+					label = "u-boot-env";
+					reg = <0x30000 0x10000>;
+					read-only;
+				};
+
+				factory: partition at 40000 {
+					label = "factory";
+					reg = <0x40000 0x10000>;
+					read-only;
+				};
+
+				partition at 50000 {
+					label = "firmware";
+					reg = <0x50000 0x3b0000>;
+				};
+			};
+		};
+		gpio1: gpio at 660 {
+			status = "okay";
+		};
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "i2c", "jtag", "uartf", "led";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	ethernet at 10100000 {
+		mtd-mac-address = <&factory 0x4>;
+	};
+
+	esw at 10110000 {
+		ralink,portmap = <0x2f>;
+	};
+
+	wmac at 10180000 {
+		ralink,mtd-eeprom = <&factory 0>;
+	};
+
+	ehci at 101c0000 {
+		status = "okay";
+	};
+
+	ohci at 101c1000 {
+		status = "okay";
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		system {
+			label = "a5-v11:blue:system";
+			gpios = <&gpio0 20 1>;
+		};
+		power {
+			label = "a5-v11:red:power";
+			gpios = <&gpio0 17 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		reset {
+			label = "reset";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x198>;
+		};
+	};
+
+	gpio_export {
+		compatible = "gpio-export";
+		#size-cells = <0>;
+
+		usb {
+			gpio-export,name = "usb";
+			gpio-export,output = <1>;
+			gpios = <&gpio0 7 0>;
+		};
+		root_hub {
+			gpio-export,name = "root_hub";
+			gpio-export,output = <1>;
+			gpios = <&gpio0 12 0>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile
index 9a47f86..584f19a 100644
--- a/target/linux/ramips/image/Makefile
+++ b/target/linux/ramips/image/Makefile
@@ -336,6 +336,8 @@ Image/Build/Profile/3G6200NL=$(call BuildFirmware/Edimax/$(1),$(1),3g-6200nl,3G-

Image/Build/Profile/3G300M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),3g300m,3G300M,$(ralink_default_fw_size_4M),3G150M_SPI Kernel Image,factory)

+Image/Build/Profile/A5-V11=$(call BuildFirmware/Poray4M/$(1),$(1),a5-v11,A5-V11)
+
Image/Build/Profile/AIR3GII=$(call BuildFirmware/Default4M/$(1),$(1),air3gii,AIR3GII)

define BuildFirmware/UIMAGE_8M
@@ -593,6 +595,7 @@ define Image/Build/Profile/Default
	$(call Image/Build/Profile/3G6200N,$(1))
	$(call Image/Build/Profile/3G6200NL,$(1))
	$(call Image/Build/Profile/3G300M,$(1))
+	$(call Image/Build/Profile/A5-11,$(1))
	$(call Image/Build/Profile/AIR3GII,$(1))
	$(call Image/Build/Profile/ALL02393G,$(1))
	$(call Image/Build/Profile/ALL0256N,$(1))
diff --git a/target/linux/ramips/rt305x/profiles/misc.mk b/target/linux/ramips/rt305x/profiles/misc.mk
new file mode 100644
index 0000000..cf7db6a
--- /dev/null
+++ b/target/linux/ramips/rt305x/profiles/misc.mk
@@ -0,0 +1,18 @@
+#
+# Copyright (C) 2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+define Profile/A5-V11
+	NAME:=A5-V11
+	PACKAGES:=\
+		kmod-usb-core kmod-usb-ohci kmod-usb2
+endef
+
+define Profile/A5-V11/Description
+	Package set for A5-V11
+endef
+
+$(eval $(call Profile,A5-V11))
diff --git a/tools/firmware-utils/src/mkporayfw.c b/tools/firmware-utils/src/mkporayfw.c
index 8e0cf24..960c604 100644
--- a/tools/firmware-utils/src/mkporayfw.c
+++ b/tools/firmware-utils/src/mkporayfw.c
@@ -60,6 +60,7 @@
#define HWID_PORAY_X1		0x38353335
#define HWID_NEXX_WT15XXX	0x30353332
#define HWID_NEXX_WT3020A	0x30323033
+#define HWID_A5_V11		0x32473352

/* Recognized XOR obfuscation keys */
#define KEY_HAME		0
@@ -69,6 +70,7 @@
#define KEY_PORAY_4		4
#define KEY_NEXX_1		5
#define KEY_NEXX_2		6
+#define KEY_A5_V11		7

/* XOR key length */
#define KEY_LEN			15
@@ -123,6 +125,7 @@ static uint8_t key[][KEY_LEN] = {
  {0x79, 0x7B, 0x7A, 0x93, 0x92, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0xE6, 0xC7},
  {0x19, 0x1C, 0x4A, 0x93, 0x96, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0x16, 0xC6},
  {0x39, 0x1C, 0x4A, 0x93, 0x96, 0x95, 0xC3, 0x63, 0xD0, 0xA3, 0x9C, 0x92, 0x2E, 0x16, 0xC6},
+  {0xC8, 0x3C, 0x3A, 0x93, 0xA2, 0x95, 0xC3, 0x63, 0x48, 0x45, 0x58, 0x09, 0x20, 0x11, 0x08},
};

static struct flash_layout layouts[] = {
@@ -139,6 +142,11 @@ static struct flash_layout layouts[] = {

static struct board_info boards[] = {
	{
+		.id             = "A5-V11",
+		.hw_id          = HWID_A5_V11,
+		.layout_id      = "4M",
+		.key            = KEY_A5_V11,
+        }, {
		.id		= "MPR-A1",
		.hw_id		= HWID_HAME_MPR_A1_L8,
		.layout_id	= "4M",
--
1.9.1
_______________________________________________
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