[LEDE-DEV] [PATCH] ar71xx:ew-dorin target moved from legacy to generic add ew-dorin-usbboot
Catrinel Catrinescu
cc at 80211.de
Wed Jul 19 02:06:28 PDT 2017
Embedded Wireless Dorin Platform moved from legacy to generic.
Add ew-dorin-usbboot target, as part of Dorin platform
Signed-off-by: Catrinel Catrinescu <cc at 80211.de>
---
target/linux/ar71xx/base-files/etc/diag.sh | 1 +
target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 ++
.../ar71xx/files/arch/mips/ath79/mach-ew-dorin.c | 54 ++++++++++++++++------
.../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 +
target/linux/ar71xx/image/generic.mk | 30 ++++++++++++
target/linux/ar71xx/image/legacy-devices.mk | 18 --------
target/linux/ar71xx/image/legacy.mk | 5 --
7 files changed, 75 insertions(+), 37 deletions(-)
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh
index 1dc48624a0..5128b8e8ae 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -191,6 +191,7 @@ get_status_led() {
status_led="easylink:green:system"
;;
ew-dorin|\
+ ew-dorin-usbboot|\
ew-dorin-router)
status_led="dorin:green:status"
;;
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 5c29a3f0d0..ed310796b3 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -634,6 +634,9 @@ ar71xx_board_detect() {
*"EmbWir-Dorin-Router")
name="ew-dorin-router"
;;
+ *EmbWir-Dorin-USBBoot)
+ name="ew-dorin-usbboot"
+ ;;
*"ENS202EXT")
name="ens202ext"
;;
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c
index e686b5fa6f..d6d4ddd61e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-dorin.c
@@ -2,7 +2,7 @@
* EW Dorin board support
* (based on Atheros Ref. Design AP121)
* Copyright (C) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
- * Copyright (C) 2012-2015 Embedded Wireless GmbH www.80211.de
+ * Copyright (C) 2012-2017 Embedded Wireless GmbH www.80211.de
*
* 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
@@ -27,25 +27,13 @@
#define DORIN_CALDATA_OFFSET 0x1000
#define DORIN_WMAC_MAC_OFFSET 0x1002
-#define DORIN_GPIO_LED_21 21
-#define DORIN_GPIO_LED_22 22
-#define DORIN_GPIO_LED_STATUS 23
+#define DORIN_GPIO_LED_STATUS 21
#define DORIN_GPIO_BTN_JUMPSTART 11
#define DORIN_GPIO_BTN_RESET 6
static struct gpio_led dorin_leds_gpio[] __initdata = {
{
- .name = "dorin:green:led21",
- .gpio = DORIN_GPIO_LED_21,
- .active_low = 1,
- },
- {
- .name = "dorin:green:led22",
- .gpio = DORIN_GPIO_LED_22,
- .active_low = 1,
- },
- {
.name = "dorin:green:status",
.gpio = DORIN_GPIO_LED_STATUS,
.active_low = 1,
@@ -148,3 +136,41 @@ static void __init ew_dorin_router_setup(void)
MIPS_MACHINE(ATH79_MACH_EW_DORIN_ROUTER, "EW-DORIN-ROUTER",
"EmbWir-Dorin-Router", ew_dorin_router_setup);
+
+
+static void __init ew_dorin_usbboot_setup(void)
+{
+ static u8 mac[6];
+ mac[0] = 0x00;
+ mac[1] = 0x1F;
+ mac[2] = 0x7D;
+ mac[3] = 0x00;
+ mac[4] = 0xBE;
+ mac[5] = 0xBE;
+
+
+ ath79_register_m25p80(NULL);
+
+ ath79_register_usb();
+
+ ath79_register_leds_gpio(-1, ARRAY_SIZE(dorin_leds_gpio), dorin_leds_gpio);
+
+ mac[3] |= 0x40;
+ ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
+
+// mac[3] &= 0x3F;
+// ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);
+// ath79_setup_ar933x_phy4_switch(true, true);
+
+ ath79_register_mdio(0, 0x0);
+
+ /* LAN ports */
+ ath79_register_eth(1);
+
+ /* WAN port */
+// ath79_register_eth(0);
+
+}
+
+MIPS_MACHINE(ATH79_MACH_EW_DORIN_USBBOOT, "EW-DORIN-USBBOOT", "EmbWir-Dorin-USBBoot",
+ ew_dorin_usbboot_setup);
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
index 0b70256338..bf974270d8 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
+++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
@@ -103,6 +103,7 @@ enum ath79_mach_type {
ATH79_MACH_ESR900, /* EnGenius ESR900 */
ATH79_MACH_EW_DORIN, /* embedded wireless Dorin Platform */
ATH79_MACH_EW_DORIN_ROUTER, /* embedded wireless Dorin Router Platform */
+ ATH79_MACH_EW_DORIN_USBBOOT, /* embedded wireless Dorin-USBBOOT Platform */
ATH79_MACH_F9K1115V2, /* Belkin AC1750DB */
ATH79_MACH_FRITZ300E, /* AVM FRITZ!WLAN Repeater 300E */
ATH79_MACH_GL_AR150, /* GL-AR150 support */
diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
index 3f1486ed63..5604a27cd9 100644
--- a/target/linux/ar71xx/image/generic.mk
+++ b/target/linux/ar71xx/image/generic.mk
@@ -207,6 +207,36 @@ define Device/dragino2
endef
TARGET_DEVICES += dragino2
+define Device/ew-dorin
+ DEVICE_TITLE := Embedded Wireless Dorin Platform
+ DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
+ BOARDNAME = EW-DORIN
+ CONSOLE := ttyATH0,115200
+ IMAGE_SIZE = 16000k
+ MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-dorin
+
+define Device/ew-dorin-router
+ DEVICE_TITLE := Embedded Wireless Dorin Router Platform
+ DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
+ BOARDNAME = EW-DORIN-ROUTER
+ CONSOLE := ttyATH0,115200
+ IMAGE_SIZE = 16000k
+ MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
+endef
+TARGET_DEVICES += ew-dorin-router
+
+define Device/ew-dorin-usbboot
+ DEVICE_TITLE := Embedded Wireless Dorin USBBoot Platform
+ DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
+ BOARDNAME = EW-DORIN-USBBOOT
+ CONSOLE := ttyATH0,115200
+ IMAGE_SIZE = 16000k
+ MTDPARTS = spi0.0:256k(u-boot),64k(u-boot-env),16000k(firmware),64k(art)
+endef
+TARGET_DEVICES += ew-dorin-usbboot
+
define Device/weio
DEVICE_TITLE := WeIO
DEVICE_PACKAGES := kmod-usb-core kmod-usb2
diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk
index 77230249af..e418282dd0 100644
--- a/target/linux/ar71xx/image/legacy-devices.mk
+++ b/target/linux/ar71xx/image/legacy-devices.mk
@@ -132,24 +132,6 @@ define LegacyDevice/DB120
endef
LEGACY_DEVICES += DB120
-define LegacyDevice/EWDORINAP
- DEVICE_TITLE := Embedded Wireless Dorin Platform (4MB flash)
- DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage
-endef
-LEGACY_DEVICES += EWDORINAP
-
-define LegacyDevice/EWDORINRT
- DEVICE_TITLE := Embedded Wireless Dorin Router
- DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage
-endef
-LEGACY_DEVICES += EWDORINRT
-
-define LegacyDevice/EWDORIN16M
- DEVICE_TITLE := Embedded Wireless Dorin Platform (16MB flash)
- DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage
-endef
-LEGACY_DEVICES += EWDORIN16M
-
define LegacyDevice/HORNETUBx2
DEVICE_TITLE := ALFA Network Hornet-UB-x2 board (16MB flash, 64MB ram)
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport
diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk
index b400e5ddbb..701116be43 100644
--- a/target/linux/ar71xx/image/legacy.mk
+++ b/target/linux/ar71xx/image/legacy.mk
@@ -258,8 +258,6 @@ cameo_ap94_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7808k(firmw
esr900_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
esr1750_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
epg5000_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),13248k(rootfs),1024k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(caldata)ro,14656k at 0x40000(firmware)
-ew-dorin_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),3712k(firmware),64k(art)ro
-ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k at 0x50000(firmware)
dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k at 0x7f0000(caldata_copy)
dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k at 0x660000(caldata_orig),6208k at 0x50000(firmware_orig)
@@ -897,9 +895,6 @@ $(eval $(call SingleProfile,AthLzma,64k,AP152_16M,ap152-16M,AP152,ttyS0,115200,$
$(eval $(call SingleProfile,AthLzma,64k,BXU2000N2,bxu2000n-2-a1,BXU2000n-2-A1,ttyS0,115200,$$(bxu2000n2_mtdlayout),RKuImage))
$(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,115200,$$(cap4200ag_mtdlayout),KRuImage))
$(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage))
-$(eval $(call SingleProfile,AthLzma,64k,EWDORINAP,ew-dorin,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
-$(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))
-$(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))
$(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
$(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))
$(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))
--
2.11.0 (Apple Git-81)
More information about the Lede-dev
mailing list