ramips: add support for Loewe WMDR-143N
authorOliver Fleischmann <ogf@bnv-bamberg.de>
Thu, 20 Jul 2017 19:02:33 +0000 (21:02 +0200)
committerMathias Kresin <dev@kresin.me>
Thu, 27 Jul 2017 07:13:27 +0000 (09:13 +0200)
The WMDR-143N is a small module originally used as a Wifi client
in some Loewe smart TV sets. It is sold cheaply at german surplus
shops. The module contains a RT3662 SOC.

Specifications:

- 500 MHz CPU Clock
- 1x 10/100Mbps Ethernet (pin header)
- 32 MB of RAM
- 8 MB of FLASH
- 2T3R 2.4/5 GHz (SOC internal)
- 3 Antennas on PCB
- UART pads on PCB (J3: 1 = +3.3V, 2 = RX, 3 = TX, 4 = GND), TX
  and RX are 3,3V only! The square hole is pin 1
- Power supply pads on PCB (J6: 1 and 2 = +5V, 3 and 4 = GND)
  The square hole is pin 1

The original firmware has two identical kernel/rootfs images and
two "Factory" calibration data blocks in flash. The LEDE image
leaves only the first "Factory" block in place and uses both
"Kernel" blocks and the redundant "Factory" block together to gain
enough space for the jffs2 partition.

Flash instructions:

You need UART and Ethernet connections to flash the board. Use
the LEDE "sysupgrade.bin" image with tftp.

Apply power to the board and in the first 5 seconds, hit 2 to
select TFTP upload. The bootloader asks for board- and server IP
addresses and filename.

Alternate method: With the vendor firmware running, assign an IP
address to the ethernet port, tftp the firmware image to
/tmp and write to mtd4 ("KernelA").

Signed-off-by: Oliver Fleischmann <ogf@bnv-bamberg.de>
[remove pinctrl node from dts, no pin is used as GPIO]
Signed-off-by: Mathias Kresin <dev@kresin.me>
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/WMDR-143N.dts [new file with mode: 0644]
target/linux/ramips/image/rt3883.mk

index ee769b5a0f32e0c4fae6305952f7fda5f3c7f7bf..cd9e08a3c2bcec53c890d00434426e42353ee7b8 100755 (executable)
@@ -230,6 +230,7 @@ ramips_setup_interfaces()
        na930|\
        pbr-d1|\
        wli-tx4-ag300n|\
+       wmdr-143n|\
        wmr-300|\
        wn3000rpv3|\
        wrh-300cr)
@@ -345,7 +346,8 @@ ramips_setup_macs()
 
        case $board in
        a5-v11|\
-       ht-tm02)
+       ht-tm02|\
+       wmdr-143n)
                lan_mac=$(cat /sys/class/net/eth0/address)
                ;;
        all0239-3g|\
index 685ba070da391edc3f7dfdb753c992ef7d7f6dee..0267c9df3fecf43fcb82da4f34d36d5ae90e2b10 100755 (executable)
@@ -598,6 +598,9 @@ ramips_board_detect() {
        *"WLR-6000")
                name="wlr-6000"
                ;;
+       *"WMDR-143N")
+               name="wmdr-143n"
+               ;;
        *"WMR-300")
                name="wmr-300"
                ;;
index b087d993b74e6cd923e09cb836b01f0cc903208b..14f5ec2cb3e380728be2ba25c4efbe9098104864 100755 (executable)
@@ -170,6 +170,7 @@ platform_check_image() {
        wl-wn575a3|\
        wli-tx4-ag300n|\
        wlr-6000|\
+       wmdr-143n|\
        wmr-300|\
        wn3000rpv3|\
        wnce2001|\
diff --git a/target/linux/ramips/dts/WMDR-143N.dts b/target/linux/ramips/dts/WMDR-143N.dts
new file mode 100644 (file)
index 0000000..ccb1df3
--- /dev/null
@@ -0,0 +1,64 @@
+/dts-v1/;
+
+#include "rt3883.dtsi"
+
+/ {
+       compatible = "loewe,wmdr-143n", "ralink,rt3883-soc";
+       model = "Loewe WMDR-143N";
+};
+
+&spi0 {
+       status = "okay";
+
+       m25p80@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partition@0 {
+                       label = "u-boot";
+                       reg = <0x0 0x30000>;
+                       read-only;
+               };
+
+               partition@30000 {
+                       label = "u-boot-env";
+                       reg = <0x30000 0x00010000>;
+                       read-only;
+               };
+
+               factory: partition@40000 {
+                       label = "factory";
+                       reg = <0x40000 0x10000>;
+                       read-only;
+               };
+
+               partition@50000 {
+                       label = "firmware";
+                       reg = <0x50000 0x7b0000>;
+               };
+       };
+};
+
+&ethernet {
+       port@0 {
+               phy-handle = <&phy0>;
+               phy-mode = "mii";
+       };
+       mdio-bus {
+               status = "okay";
+
+               phy0: ethernet-phy@0 {
+                       reg = <0>;
+                       phy-mode = "mii";
+               };
+       };
+};
+
+&wmac {
+       status = "okay";
+       ralink,mtd-eeprom = <&factory 0>;
+       mtd-mac-address = <&factory 0x4>;
+};
index 2cd60f3858b5c4c77c53434bf9ee7af3fb972c98..f90fc6154fdae04f96d6faf832dbc3a7c62f375e 100644 (file)
@@ -114,3 +114,11 @@ define Device/wlr-6000
   DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 swconfig
 endef
 TARGET_DEVICES += wlr-6000
+
+
+define Device/wmdr-143n
+  DTS := WMDR-143N
+  BLOCKSIZE := 64k
+  DEVICE_TITLE := Loewe WMDR-143N
+endef
+TARGET_DEVICES += wmdr-143n