I don't why it happened but my mail client wrapped some of the lines. Sending 
patches again as an attachment.
Index: target/linux/ramips/base-files/lib/upgrade/platform.sh
===================================================================
--- target/linux/ramips/base-files/lib/upgrade/platform.sh	(revision 32505)
+++ target/linux/ramips/base-files/lib/upgrade/platform.sh	(working copy)
@@ -14,6 +14,7 @@
 	[ "$ARGC" -gt 1 ] && return 1
 
 	case "$board" in
+	3g-6200n | \
 	all0256n | \
 	bc2 | \
 	dir-300-b1 | \
Index: target/linux/ramips/base-files/lib/preinit/06_set_iface_mac
===================================================================
--- target/linux/ramips/base-files/lib/preinit/06_set_iface_mac	(revision 32505)
+++ target/linux/ramips/base-files/lib/preinit/06_set_iface_mac	(working copy)
@@ -8,6 +8,10 @@
 	. /lib/ramips.sh
 
 	case $(ramips_board_name) in
+	3g-6200n)
+		mac=$(ramips_get_mac_binary factory 4)
+		ifconfig eth0 hw ether $mac 2>/dev/null
+		;;
 	bc2 |\
 	esr-9753 |\
 	freestation5 |\
Index: target/linux/ramips/base-files/lib/ramips.sh
===================================================================
--- target/linux/ramips/base-files/lib/ramips.sh	(revision 32505)
+++ target/linux/ramips/base-files/lib/ramips.sh	(working copy)
@@ -47,6 +47,9 @@
 	machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /machine/ {print $2}' /proc/cpuinfo)
 
 	case "$machine" in
+	*"Edimax 3g-6200n")
+		name="3g-6200n"
+		;;
 	*"Allnet ALL0256N")
 		name="all0256n"
 		;;
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 32505)
+++ target/linux/ramips/base-files/etc/hotplug.d/firmware/10-rt2x00-eeprom	(working copy)
@@ -47,7 +47,8 @@
 	f5d8235-v2)
 		rt2x00_eeprom_extract "u-boot" 262144 272
 		;;
-
+	
+	3g-6200n | \
 	all0256n | \
 	argus-atp52b | \
 	bc2 | \
Index: target/linux/ramips/base-files/etc/uci-defaults/leds
===================================================================
--- target/linux/ramips/base-files/etc/uci-defaults/leds	(revision 32505)
+++ target/linux/ramips/base-files/etc/uci-defaults/leds	(working copy)
@@ -14,6 +14,10 @@
 board=$(ramips_board_name)
 
 case $board in
+	3g-6200n)
+		set_wifi_led "edimax:amber:wlan"
+		set_usb_led "edimax:blue:3g"
+		;;
 	all0256n)
 		set_wifi_led "rt2800pci-phy0::radio"
 		;;
Index: target/linux/ramips/base-files/etc/uci-defaults/network
===================================================================
--- target/linux/ramips/base-files/etc/uci-defaults/network	(revision 32505)
+++ target/linux/ramips/base-files/etc/uci-defaults/network	(working copy)
@@ -20,7 +20,8 @@
 	wl-330n)
 		ucidef_set_interface_lan "eth0.1"
 		;;
-
+	
+	3g-6200n | \
 	argus-atp52b | \
 	b2c | \
 	nw718 | \
@@ -89,7 +90,7 @@
 	all0256n)
 		lan_mac=$(ramips_get_mac_binary factory 40)
 		;;
-
+	3g-6200n | \
 	argus-atp52b | \
 	b2c | \
 	f5d8235-v1 | \
Index: target/linux/ramips/base-files/etc/diag.sh
===================================================================
--- target/linux/ramips/base-files/etc/diag.sh	(revision 32505)
+++ target/linux/ramips/base-files/etc/diag.sh	(working copy)
@@ -30,6 +30,9 @@
 
 get_status_led() {
 	case $(ramips_board_name) in
+	3g-6200n)
+		status_led="edimax:green:power"
+		;;
 	argus-atp52b)
 		status_led="argus-atp52b:green:run"
 		;;
Index: target/linux/ramips/image/Makefile
===================================================================
--- target/linux/ramips/image/Makefile	(revision 32505)
+++ target/linux/ramips/image/Makefile	(working copy)
@@ -124,6 +124,11 @@
 	$(call BuildFirmware/Generic/initramfs,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_8M)))
 endef
 
+mtdlayout_edimax_3g6200n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2752k(rootfs),128k@0x3e0000(cimage)ro,3648k@0x50000(firmware)
+define BuildFirmware/3G6200N
+	$(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_edimax_3g6200n)),917504,2818048) 
+endef
+
 mtdlayout_argus_atp52b=192k(bootloader)ro,64k(config),64k(factory),1152k(kernel),6656k(rootfs),7808k@0x50000(firmware)
 mtd_argus_atp52b_kernel_part_size=1179648
 mtd_argus_atp52b_rootfs_part_size=6815744
@@ -312,6 +317,10 @@
 #
 # RT305X Profiles
 #
+define Image/Build/Profile/3G6200N
+	$(call Image/Build/Template/$(fs_squash)/$(1),3G6200N,3g-6200n,3G-6200N,ttyS1,57600,phys)
+endef
+
 define Image/Build/Profile/ALL0256N
 	$(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,all0256n,ALL0256N,ttyS1,57600,spi)
 endef
@@ -444,6 +453,7 @@
 
 ifeq ($(CONFIG_RALINK_RT305X),y)
 define Image/Build/Profile/Default
+	$(call Image/Build/Profile/3G6200N,$(1))
 	$(call Image/Build/Profile/ALL0256N,$(1))
 	$(call Image/Build/Profile/ARGUS_ATP52B,$(1))
 	$(call Image/Build/Profile/BC2,$(1))
Index: target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h
===================================================================
--- target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h	(revision 32505)
+++ target/linux/ramips/files/arch/mips/include/asm/mach-ralink/machine.h	(working copy)
@@ -21,6 +21,7 @@
 	RAMIPS_MACH_WZR_AGL300NH,	/* Buffalo WZR-AGL300NH */
 
 	/* RT3050 based machines */
+	RAMIPS_MACH_3G_6200N,		/* Edimax 3G-6200N */
 	RAMIPS_MACH_ALL0256N,		/* Allnet ALL0256N */
 	RAMIPS_MACH_DIR_300_B1,		/* D-Link DIR-300 B1 */
 	RAMIPS_MACH_DIR_600_B1,		/* D-Link DIR-600 B1 */
Index: target/linux/ramips/files/arch/mips/ralink/rt305x/mach-3g-6200n.c
===================================================================
--- target/linux/ramips/files/arch/mips/ralink/rt305x/mach-3g-6200n.c	(revision 0)
+++ target/linux/ramips/files/arch/mips/ralink/rt305x/mach-3g-6200n.c	(working copy)
@@ -0,0 +1,87 @@
+/*
+ *  Edimax 3g-6200n board support
+ *
+ *  Copyright (C) 2011 Andrzej Hajda <andrzej.ha...@wp.pl>
+ *  Copyright (C) 2012 Lukasz Golebiowski <lgole...@gmail.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify it
+ *  under the terms of the GNU General Public License version 2 as published
+ *  by the Free Software Foundation.
+ */
+
+
+#include <linux/init.h>
+#include <linux/platform_device.h>
+
+#include <asm/mach-ralink/machine.h>
+#include <asm/mach-ralink/dev-gpio-buttons.h>
+#include <asm/mach-ralink/dev-gpio-leds.h>
+#include <asm/mach-ralink/rt305x.h>
+#include <asm/mach-ralink/rt305x_regs.h>
+
+#include "devices.h"
+
+#define EDIMAX_GPIO_BUTTON_WPS 12
+#define EDIMAX_GPIO_BTN_0 13 /* Wifi on/off switch button */
+
+#define EDIMAX_GPIO_LED_POWER  9
+#define EDIMAX_GPIO_LED_WLAN   14
+#define EDIMAX_GPIO_LED_3G     7
+
+#define EDIMAX_KEYS_POLL_INTERVAL   20
+#define EDIMAX_KEYS_DEBOUNCE_INTERVAL (3 * EDIMAX_KEYS_POLL_INTERVAL)
+
+static struct gpio_led edimax_leds_gpio[] __initdata = {
+       {
+               .name           = "edimax:green:power",
+               .gpio           = EDIMAX_GPIO_LED_POWER,
+               .active_low     = 1,
+       }, {
+               .name           = "edimax:amber:wlan",
+               .gpio           = EDIMAX_GPIO_LED_WLAN,
+               .active_low     = 1,
+       }, {
+               .name           = "edimax:blue:3g",
+               .gpio           = EDIMAX_GPIO_LED_3G,
+               .active_low     = 1,
+       }
+};
+
+static struct gpio_keys_button edimax_gpio_buttons[] __initdata = {
+       {
+               .desc           = "wps",
+               .type           = EV_KEY,
+               .code           = KEY_WPS_BUTTON,
+	       .debounce_interval = EDIMAX_KEYS_DEBOUNCE_INTERVAL,
+               .gpio           = EDIMAX_GPIO_BUTTON_WPS,
+               .active_low     = 1,
+       }, {
+	       .desc		= "wlanswitch",
+	       .type		= EV_KEY,
+	       .code		= BTN_0,
+	       .debounce_interval = EDIMAX_KEYS_DEBOUNCE_INTERVAL,
+	       .gpio		= EDIMAX_GPIO_BTN_0,
+	       .active_low	= 1,
+	}
+};
+
+static void __init edimax_init(void)
+{
+       rt305x_gpio_init(RT305X_GPIO_MODE_GPIO << RT305X_GPIO_MODE_UART0_SHIFT);
+
+       rt305x_register_flash(0);
+       rt305x_esw_data.vlan_config = RT305X_ESW_VLAN_CONFIG_LLLLW;
+       rt305x_register_ethernet();
+       ramips_register_gpio_leds(-1, ARRAY_SIZE(edimax_leds_gpio),
+                                 edimax_leds_gpio);
+       ramips_register_gpio_buttons(-1, EDIMAX_KEYS_POLL_INTERVAL,
+                                    ARRAY_SIZE(edimax_gpio_buttons),
+                                    edimax_gpio_buttons);
+       rt305x_register_wifi();
+       rt305x_register_wdt();
+       rt305x_register_usb();
+}
+
+MIPS_MACHINE(RAMIPS_MACH_3G_6200N, "3G-6200N", "Edimax 3g-6200n",
+            edimax_init);
+
Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig
===================================================================
--- target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig	(revision 32505)
+++ target/linux/ramips/files/arch/mips/ralink/rt305x/Kconfig	(working copy)
@@ -2,6 +2,11 @@
 
 menu "Ralink RT350x machine selection"
 
+config RT305X_MACH_3G_6200N
+	bool "Edimax 3G-6200N board support"
+	select RALINK_DEV_GPIO_BUTTONS
+	select RALINK_DEV_GPIO_LEDS
+
 config RT305X_MACH_WR6202
 	bool "Accton WR6202"
 	select RALINK_DEV_GPIO_BUTTONS
Index: target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile
===================================================================
--- target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile	(revision 32505)
+++ target/linux/ramips/files/arch/mips/ralink/rt305x/Makefile	(working copy)
@@ -11,6 +11,7 @@
 
 obj-$(CONFIG_EARLY_PRINTK)		+= early_printk.o
 
+obj-$(CONFIG_RT305X_MACH_3G_6200N)	+= mach-3g-6200n.o
 obj-$(CONFIG_RT305X_MACH_ARGUS_ATP52B)	+= mach-argus-atp52b.o
 obj-$(CONFIG_RT305X_MACH_BC2)		+= mach-bc2.o
 obj-$(CONFIG_RT305X_MACH_ALL0256N)	+= mach-all0256n.o
Index: target/linux/ramips/rt305x/config-3.3
===================================================================
--- target/linux/ramips/rt305x/config-3.3	(revision 32505)
+++ target/linux/ramips/rt305x/config-3.3	(working copy)
@@ -87,6 +87,7 @@
 CONFIG_RALINK_RT305X=y
 # CONFIG_RALINK_RT3883 is not set
 CONFIG_RAMIPS_WDT=y
+CONFIG_RT305X_MACH_3G_6200N=y
 CONFIG_RT305X_MACH_ALL0256N=y
 CONFIG_RT305X_MACH_ARGUS_ATP52B=y
 CONFIG_RT305X_MACH_BC2=y
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to