Patchwork [OpenWrt-Devel,ramips] : add support for SMCWBR14S-N3

login
register
Submitter dani
Date 2014-03-17 11:13:07
Message ID <2093269.pZb6yCaKQM@tool>
Download mbox | patch
Permalink /patch/5018/
State Rejected
Headers show

Comments

dani - 2014-03-17 11:13:07
This patch adds support for a new rt3052 board, SMC SMCWBR14S-N3

- Only two GPIO leds, one has no label, I labeled it as "extra"
- 4 ethernet LAN, 1 ethernet WAN
- No USB port, but the pads are visible at the board ready for soldering.
- Two GPIO buttons, WPS and reset.

I'm new to this platform and it isn't clear to me the purpose of the factory partition, I suppose it 
has some data for the wifi calibration?, well this is mine:

0000:0000 | 52 30 01 01  00 22 2D 8C  DC 9A FF FF  FF FF FF FF | R0..."-.Ü.ÿÿÿÿÿÿ
0000:0010 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0020 | FF FF FF FF  FF FF FF FF  00 22 2D 8C  DC 98 00 22 | ÿÿÿÿÿÿÿÿ."-.Ü.."
0000:0030 | 2D 8C DC 99  22 08 34 12  FF FF 1E 01  55 77 A8 AA | -.Ü.".4.ÿÿ..Uw¨ª
0000:0040 | 8C 88 FF FF  0A 00 00 00  00 00 00 00  00 00 FF FF | ..ÿÿ..........ÿÿ
0000:0050 | FF FF 11 11  11 11 10 10  10 10 11 11  11 11 11 11 | ÿÿ..............
0000:0060 | 1E 1E 1E 1E  1E 1E 1E 1E  1C 1C 1C 1C  1C 1C FF F7 | ..............ÿ÷
0000:0070 | E0 A0 80 44  28 10 FF 01  FF FF FF FF  FF FF FF FF | à .D(.ÿ.ÿÿÿÿÿÿÿÿ
0000:0080 | FF FF FF FF  FF FF FF FF  52 30 31 00  45 55 FF FF | ÿÿÿÿÿÿÿÿR01.EUÿÿ
0000:0090 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:00A0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:00B0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:00C0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:00D0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF 66 66 | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿff
0000:00E0 | CC AA 88 66  CC AA 88 66  CC AA 88 66  CC AA 88 66 | ̪.f̪.f̪.f̪.f
0000:00F0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0100 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0110 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0120 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0130 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0140 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0150 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0160 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0170 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0180 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:0190 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:01A0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:01B0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:01C0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:01D0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:01E0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
0000:01F0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF | ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

I tested the patch with latest trunk flashed via uBoot, all working ok. Wifi works, but when active the router
becomes stunned with high CPU loads. I assume this is caused by the lack of RAM (only 16 MB).

Bootlogs
http://wiki.openwrt.org/toh/smc/smcwbr14s-n3#bootlogs

Signed-off-by: Daniel Gonzalez <dgcbueu@gmail.com>
José Vázquez Fernández - 2014-03-17 17:09:49
Seems that this patch adds support for the SMCWEBS-N too.
Is not needed a board definition file?

2014-03-17 12:13 GMT+01:00, dani <dgcbueu@gmail.com>:
> This patch adds support for a new rt3052 board, SMC SMCWBR14S-N3
>
> - Only two GPIO leds, one has no label, I labeled it as "extra"
> - 4 ethernet LAN, 1 ethernet WAN
> - No USB port, but the pads are visible at the board ready for soldering.
> - Two GPIO buttons, WPS and reset.
>
> I'm new to this platform and it isn't clear to me the purpose of the factory
> partition, I suppose it
> has some data for the wifi calibration?, well this is mine:
>
> 0000:0000 | 52 30 01 01  00 22 2D 8C  DC 9A FF FF  FF FF FF FF |
> R0..."-.Ü.ÿÿÿÿÿÿ
> 0000:0010 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0020 | FF FF FF FF  FF FF FF FF  00 22 2D 8C  DC 98 00 22 |
> ÿÿÿÿÿÿÿÿ."-.Ü.."
> 0000:0030 | 2D 8C DC 99  22 08 34 12  FF FF 1E 01  55 77 A8 AA |
> -.Ü.".4.ÿÿ..Uw¨ª
> 0000:0040 | 8C 88 FF FF  0A 00 00 00  00 00 00 00  00 00 FF FF |
> ..ÿÿ..........ÿÿ
> 0000:0050 | FF FF 11 11  11 11 10 10  10 10 11 11  11 11 11 11 |
> ÿÿ..............
> 0000:0060 | 1E 1E 1E 1E  1E 1E 1E 1E  1C 1C 1C 1C  1C 1C FF F7 |
> ..............ÿ÷
> 0000:0070 | E0 A0 80 44  28 10 FF 01  FF FF FF FF  FF FF FF FF | à
> .D(.ÿ.ÿÿÿÿÿÿÿÿ
> 0000:0080 | FF FF FF FF  FF FF FF FF  52 30 31 00  45 55 FF FF |
> ÿÿÿÿÿÿÿÿR01.EUÿÿ
> 0000:0090 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:00A0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:00B0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:00C0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:00D0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF 66 66 |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿff
> 0000:00E0 | CC AA 88 66  CC AA 88 66  CC AA 88 66  CC AA 88 66 |
> ̪.f̪.f̪.f̪.f
> 0000:00F0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0100 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0110 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0120 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0130 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0140 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0150 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0160 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0170 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0180 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:0190 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:01A0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:01B0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:01C0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:01D0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:01E0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
> 0000:01F0 | FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF |
> ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
>
> I tested the patch with latest trunk flashed via uBoot, all working ok. Wifi
> works, but when active the router
> becomes stunned with high CPU loads. I assume this is caused by the lack of
> RAM (only 16 MB).
>
> Bootlogs
> http://wiki.openwrt.org/toh/smc/smcwbr14s-n3#bootlogs
>
> Signed-off-by: Daniel Gonzalez <dgcbueu@gmail.com>
>

Patch

Index: target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom
===================================================================
--- target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom	(revision 39930)
+++ target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom	(working copy)
@@ -96,6 +96,7 @@ 
 	rt-n15 | \
 	rt-n56u | \
 	sl-r7205 | \
+	smcwbr14s-n3 | \
 	v11st-fe | \
 	v22rw-2x2 | \
 	w306r-v20 | \
Index: target/linux/ramips/base-files/etc/uci-defaults/02_network
===================================================================
--- target/linux/ramips/base-files/etc/uci-defaults/02_network	(revision 39930)
+++ target/linux/ramips/base-files/etc/uci-defaults/02_network	(working copy)
@@ -96,6 +96,7 @@ 
 	f5d8235-v2 | \
 	hg255d | \
 	rt-n14u | \
+	smcwbr14s-n3 | \
 	wrtnode | \
 	ur-326n4g)
 		ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
Index: target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
===================================================================
--- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac	(revision 39930)
+++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac	(working copy)
@@ -34,6 +34,7 @@ 
 	dir-320-b1 | \
 	psr-680w |\
 	rt-n56u |\
+	smcwbr14s-n3 |\
 	sl-r7205)
 		mac=$(mtd_get_mac_binary factory 4)
 		mac=$(macaddr_setbit_la "$mac")
Index: target/linux/ramips/base-files/lib/ramips.sh
===================================================================
--- target/linux/ramips/base-files/lib/ramips.sh	(revision 39930)
+++ target/linux/ramips/base-files/lib/ramips.sh	(working copy)
@@ -208,6 +208,9 @@ 
 	*"Skyline SL-R7205"*)
 		name="sl-r7205"
 		;;
+	*"SMCWBR14S-N3")
+		name="smcwbr14s-n3"
+		;;
 	*"Sparklan WCR-150GN")
 		name="wcr-150gn"
 		;;
Index: target/linux/ramips/base-files/lib/upgrade/platform.sh
===================================================================
--- target/linux/ramips/base-files/lib/upgrade/platform.sh	(revision 39930)
+++ target/linux/ramips/base-files/lib/upgrade/platform.sh	(working copy)
@@ -68,6 +68,7 @@ 
 	rt-n15 | \
 	rt-n56u | \
 	sl-r7205 | \
+	smcwbr14s-n3 | \
 	tew-691gr | \
 	tew-692gr | \
 	w306r-v20 |\
Index: target/linux/ramips/dts/SMCWBR14S-N3.dts
===================================================================
--- target/linux/ramips/dts/SMCWBR14S-N3.dts	(revision 0)
+++ target/linux/ramips/dts/SMCWBR14S-N3.dts	(working copy)
@@ -0,0 +1,91 @@ 
+/dts-v1/;
+
+/include/ "rt3050.dtsi"
+
+/ {
+	compatible = "SMCWBR14S-N3", "ralink,rt3052-soc";
+	model = "SMC SMCWBR14S-N3";
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	pinctrl {
+		state_default: pinctrl0 {
+			gpio {
+				ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
+				ralink,function = "gpio";
+			};
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+		wps {
+			label = "wbr14s:blue:wps";
+			gpios = <&gpio0 14 1>;
+		};
+		extra {
+			label = "wbr14s:blue:extra";
+			gpios = <&gpio0 13 1>;
+		};
+	};
+
+	gpio-keys-polled {
+		compatible = "gpio-keys-polled";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		poll-interval = <20>;
+		reset {
+			label = "reset";
+			gpios = <&gpio0 10 1>;
+			linux,code = <0x198>;
+		};
+		wps {
+			label = "wps";
+			gpios = <&gpio0 0 1>;
+			linux,code = <0x211>;
+		};
+	};
+
+	cfi@1f000000 {
+		compatible = "cfi-flash";
+		reg = <0x1f000000 0x800000>;
+
+		bank-width = <2>;
+		device-width = <2>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		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>;
+		};
+	};
+
+	esw@10110000 {
+		ralink,portmap = <0x3e>;
+	};
+
+	otg@101c0000 {
+		status = "okay";
+	};
+};
Index: target/linux/ramips/image/Makefile
===================================================================
--- target/linux/ramips/image/Makefile	(revision 39930)
+++ target/linux/ramips/image/Makefile	(working copy)
@@ -441,6 +441,8 @@ 
 
 Image/Build/Profile/SL-R7205=$(call BuildFirmware/Default4M/$(1),$(1),sl-r7205,SL-R7205)
 
+Image/Build/Profile/SMCWBR11S-3GN=$(call BuildFirmware/Default4M/$(1),$(1),smcwbr14s-n3,SMCWBR14S-N3,Linux Kernel Image)
+
 Image/Build/Profile/V22RW-2X2=$(call BuildFirmware/Default4M/$(1),$(1),v22rw-2x2,V22RW-2X2)
 
 Image/Build/Profile/W150M=$(call BuildFirmware/CustomFlashFactory/$(1),$(1),w150m,W150M,$(ralink_default_fw_size_4M),W150M Kernel Image,factory)
@@ -574,6 +576,7 @@ 
 	$(call Image/Build/Profile/RTN10PLUS,$(1))
 	$(call Image/Build/Profile/RT-N13U,$(1))
 	$(call Image/Build/Profile/SL-R7205,$(1))
+	$(call Image/Build/Profile/SMCWBR11S-3GN,$(1))
 	$(call Image/Build/Profile/UR-326N4G,$(1))
 	$(call Image/Build/Profile/V22RW-2X2,$(1))
 	$(call Image/Build/Profile/W150M,$(1))