ramips: add support for A5-V11 board (resubmit)
authorJohn Crispin <john@openwrt.org>
Wed, 29 Oct 2014 11:01:17 +0000 (11:01 +0000)
committerJohn Crispin <john@openwrt.org>
Wed, 29 Oct 2014 11:01:17 +0000 (11:01 +0000)
(Reposted due to an issue with the patchwork server during original submission)

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 <gareth@mx9.org>
SVN-Revision: 43102

target/linux/ramips/base-files/etc/board.d/01_leds
target/linux/ramips/base-files/etc/board.d/02_network
target/linux/ramips/base-files/lib/ramips.sh
target/linux/ramips/base-files/lib/upgrade/platform.sh
target/linux/ramips/dts/A5-V11.dts [new file with mode: 0644]
target/linux/ramips/image/Makefile
target/linux/ramips/rt305x/profiles/misc.mk [new file with mode: 0644]
tools/firmware-utils/src/mkporayfw.c

index 7ca7ffb..4a482b3 100755 (executable)
@@ -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"
index ff8fbc0..6510b1a 100755 (executable)
@@ -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 |\
index 88fa623..b2b299d 100755 (executable)
@@ -25,6 +25,9 @@ ramips_board_detect() {
        *"Edimax 3g-6200nl")
                name="3g-6200nl"
                ;;
+       *"A5-V11")
+               name="a5-v11"
+               ;;
        *"Airlink101 AR725W")
                name="ar725w"
                ;;
index c9a418e..4fe0ef4 100755 (executable)
@@ -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 (file)
index 0000000..154074a
--- /dev/null
@@ -0,0 +1,117 @@
+/dts-v1/;
+
+/include/ "rt5350.dtsi"
+
+/ {
+       compatible = "A5-V11", "ralink,rt5350-soc";
+       model = "A5-V11";
+
+       palmbus@10000000 {
+               spi@b00 {
+                       status = "okay";
+                       m25p80@0 {
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+                               compatible = "pm25lq032";
+                               reg = <0 0>;
+                               linux,modalias = "m25p80", "pm25lq032";
+                               spi-max-frequency = <10000000>;
+
+                               partition@0 {
+                                       label = "u-boot";
+                                       reg = <0x0 0x30000>;
+                                       read-only;
+                               };
+
+                               partition@30000 {
+                                       label = "u-boot-env";
+                                       reg = <0x30000 0x10000>;
+                                       read-only;
+                               };
+
+                               factory: partition@40000 {
+                                       label = "factory";
+                                       reg = <0x40000 0x10000>;
+                                       read-only;
+                               };
+
+                               partition@50000 {
+                                       label = "firmware";
+                                       reg = <0x50000 0x3b0000>;
+                               };
+                       };
+               };
+               gpio1: gpio@660 {
+                       status = "okay";
+               };
+       };
+
+       pinctrl {
+               state_default: pinctrl0 {
+                       gpio {
+                               ralink,group = "i2c", "jtag", "uartf", "led";
+                               ralink,function = "gpio";
+                       };
+               };
+       };
+
+       ethernet@10100000 {
+               mtd-mac-address = <&factory 0x4>;
+       };
+
+       esw@10110000 {
+               ralink,portmap = <0x2f>;
+       };
+
+       wmac@10180000 {
+               ralink,mtd-eeprom = <&factory 0>;
+       };
+
+       ehci@101c0000 {
+               status = "okay";
+       };
+
+       ohci@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>;
+               };
+       };
+};
index 9317779..759de53 100644 (file)
@@ -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 (file)
index 0000000..cf7db6a
--- /dev/null
@@ -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))
index 8e0cf24..960c604 100644 (file)
@@ -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",