Re: [LEDE-DEV] [PATCH v3] ar71xx: add ew-balin platform from Embedded Wireless

2018-01-12 Thread John Crispin

Hi,

few small comments inline.


On 11/01/18 11:27, Catrinel Catrinescu wrote:

Add the Embedded Wireless "Balin" platform, based on AR9344:
http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf


Can you please write the HW spec into the commit message ? the PDF link 
might be gone one day.


The module comes already with the current vanilla OpenWRT firmware,
so no need to install "factory"-image, or any other stuff:-)

Signed-off-by: Catrinel Catrinescu 
---
  .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
  target/linux/ar71xx/base-files/etc/diag.sh |   3 +
  .../etc/uci-defaults/03_network-switchX-migration  |   1 +
  target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
  .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
  target/linux/ar71xx/config-4.4 |   1 +
  target/linux/ar71xx/config-4.9 |   1 +
  .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
  target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
  .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +
  .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
  target/linux/ar71xx/image/generic.mk   |   9 ++
  target/linux/ar71xx/mikrotik/config-default|   1 +
  target/linux/ar71xx/nand/config-default|   1 +
  14 files changed, 152 insertions(+)
  create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c


[...]

diff --git 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
index 29fdde40a0..898082f552 100644
--- 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
+++ 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
@@ -53,6 +53,7 @@ dir-615-e1|\
  dir-615-e4|\
  dir-825-c1|\
  ebr-2310-c1|\
+ew-balin|\
  ew-dorin|\
  ew-dorin-router|\
  ja76pf|\


no need to add switch migration for new boards. please drop this part of 
the patch.


    John





diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b5440230a5..162742a94c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -640,6 +640,9 @@ ar71xx_board_detect() {
*"EL-MINI")
name="el-mini"
;;
+   *EmbWir-Balin)
+   name="ew-balin"
+   ;;
*"EmbWir-Dorin")
name="ew-dorin"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ecf6820a2b..9dceadc563 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -237,6 +237,7 @@ platform_check_image() {
epg5000|\
esr1750|\
esr900|\
+   ew-balin|\
ew-dorin|\
ew-dorin-router|\
gl-ar150|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 5a8004a03e..36b266f21c 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
  CONFIG_ATH79_MACH_EPG5000=y
  CONFIG_ATH79_MACH_ESR1750=y
  CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
  CONFIG_ATH79_MACH_EW_DORIN=y
  CONFIG_ATH79_MACH_F9K1115V2=y
  CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 4334d25b80..d51fe5f797 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
  CONFIG_ATH79_MACH_EPG5000=y
  CONFIG_ATH79_MACH_ESR1750=y
  CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
  CONFIG_ATH79_MACH_EW_DORIN=y
  CONFIG_ATH79_MACH_F9K1115V2=y
  CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt 
b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
index 1198fcb74b..a94c5a3a2e 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
+++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt
@@ -702,6 +702,17 @@ config ATH79_MACH_ESR900
select ATH79_DEV_WMAC
select ATH79_NVRAM
  
+config ATH79_MACH_EW_BALIN

+   bool "embedded wireless Balin Platform support"
+   select SOC_AR934X
+   select ATH79_DEV_M25P80
+   select ATH79_DEV_GPIO_BUTTONS
+   select ATH79_DEV_LEDS_GPIO
+   select ATH79_DEV_WMAC
+   select ATH79_DEV_ETH
+   select ATH79_DEV_USB
+   select ATH79_DEV_AP9X_PCI if PCI
+
  config ATH79_MACH_EW_DORIN
bool "embedded wireless Dorin Platform support"
select SOC_AR933X
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile 
b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
index 455af762e3..bde1b75308 100644
--- a/target/linux/ar

[LEDE-DEV] [PATCH v3] ar71xx: add ew-balin platform from Embedded Wireless

2018-01-11 Thread Catrinel Catrinescu
Add the Embedded Wireless "Balin" platform, based on AR9344:
http://www.embeddedwireless.de/uploads/Balin_data_2016_10.pdf

The module comes already with the current vanilla OpenWRT firmware,
so no need to install "factory"-image, or any other stuff:-)

Signed-off-by: Catrinel Catrinescu 
---
 .../linux/ar71xx/base-files/etc/board.d/02_network |   6 ++
 target/linux/ar71xx/base-files/etc/diag.sh |   3 +
 .../etc/uci-defaults/03_network-switchX-migration  |   1 +
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   1 +
 target/linux/ar71xx/config-4.4 |   1 +
 target/linux/ar71xx/config-4.9 |   1 +
 .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt   |  11 ++
 target/linux/ar71xx/files/arch/mips/ath79/Makefile |   1 +
 .../ar71xx/files/arch/mips/ath79/mach-ew-balin.c   | 112 +
 .../linux/ar71xx/files/arch/mips/ath79/machtypes.h |   1 +
 target/linux/ar71xx/image/generic.mk   |   9 ++
 target/linux/ar71xx/mikrotik/config-default|   1 +
 target/linux/ar71xx/nand/config-default|   1 +
 14 files changed, 152 insertions(+)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c

diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network 
b/target/linux/ar71xx/base-files/etc/board.d/02_network
index fb61792bf4..4919e7c983 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/02_network
+++ b/target/linux/ar71xx/base-files/etc/board.d/02_network
@@ -368,6 +368,12 @@ ar71xx_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
;;
+   ew-balin)
+   ucidef_set_interface_raw "usb2" "usb0" "static"
+   ucidef_set_interface_raw "usb3" "usb0" "static"
+   ucidef_add_switch "switch0" \
+   "0@eth0" "5:lan:4" "4:lan:5" "3:wan"
+   ;;
ew-dorin)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan" "2:lan" "3:wan"
diff --git a/target/linux/ar71xx/base-files/etc/diag.sh 
b/target/linux/ar71xx/base-files/etc/diag.sh
index 6cbb3576d8..ca73d5f62b 100644
--- a/target/linux/ar71xx/base-files/etc/diag.sh
+++ b/target/linux/ar71xx/base-files/etc/diag.sh
@@ -193,6 +193,9 @@ get_status_led() {
el-mini)
status_led="easylink:green:system"
;;
+   ew-balin)
+   status_led="balin:green:status"
+   ;;
ew-dorin|\
ew-dorin-router)
status_led="dorin:green:status"
diff --git 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
index 29fdde40a0..898082f552 100644
--- 
a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
+++ 
b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration
@@ -53,6 +53,7 @@ dir-615-e1|\
 dir-615-e4|\
 dir-825-c1|\
 ebr-2310-c1|\
+ew-balin|\
 ew-dorin|\
 ew-dorin-router|\
 ja76pf|\
diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index b5440230a5..162742a94c 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -640,6 +640,9 @@ ar71xx_board_detect() {
*"EL-MINI")
name="el-mini"
;;
+   *EmbWir-Balin)
+   name="ew-balin"
+   ;;
*"EmbWir-Dorin")
name="ew-dorin"
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index ecf6820a2b..9dceadc563 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -237,6 +237,7 @@ platform_check_image() {
epg5000|\
esr1750|\
esr900|\
+   ew-balin|\
ew-dorin|\
ew-dorin-router|\
gl-ar150|\
diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4
index 5a8004a03e..36b266f21c 100644
--- a/target/linux/ar71xx/config-4.4
+++ b/target/linux/ar71xx/config-4.4
@@ -109,6 +109,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH_F9K1115V2=y
 CONFIG_ATH79_MACH_FRITZ300E=y
diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9
index 4334d25b80..d51fe5f797 100644
--- a/target/linux/ar71xx/config-4.9
+++ b/target/linux/ar71xx/config-4.9
@@ -107,6 +107,7 @@ CONFIG_ATH79_MACH_ENS202EXT=y
 CONFIG_ATH79_MACH_EPG5000=y
 CONFIG_ATH79_MACH_ESR1750=y
 CONFIG_ATH79_MACH_ESR900=y
+CONFIG_ATH79_MACH_EW_BALIN=y
 CONFIG_ATH79_MACH_EW_DORIN=y
 CONFIG_ATH79_MACH