Re: [OpenWrt-Devel] [RFC 2/2] Add support for the Meraki MR24

2016-04-01 Thread Chris Blake
Hey Imre,

On Fri, Apr 1, 2016 at 7:39 AM, Imre Kaloz  wrote:
> On Fri, 01 Apr 2016 03:46:10 +0200, Chris Blake 
> wrote:
>
>> This patch adds support for the Meraki MR24 Access point to the apm821xx
>> target. More info on the device can be found at
>> https://wiki.openwrt.org/toh/meraki/mr24
>>
>> Signed-off-by: Chris Blake 
>
>
>> --- /dev/null
>> +++ b/target/linux/apm821xx/dts/MR24.dts
>> @@ -0,0 +1,433 @@
>> +/*
>> + * Device Tree Source for Meraki MR24 (Ikarem)
>> + *
>> + * Copyright (C) 2016 Chris Blake 
>> + *
>> + * Based on Cisco Meraki GPL Release r23-20150601 MR24 DTS
>> + *
>> + * This file is licensed under the terms of the GNU General Public
>> + * License version 2.  This program is licensed "as is" without
>> + * any warranty of any kind, whether express or implied.
>> + */
>> +
>> +/dts-v1/;
>> +
>> +/ {
>> +   #address-cells = <2>;
>> +   #size-cells = <1>;
>> +   model = "Meraki MR24 Access Point";
>> +   compatible = "apm,bluestone";
>
>
> This should be "meraki,ikarem" if that's the codename for the box.
>

From my understanding this should stay as "apm,bluestone" as this is
what the dts was based on, and needs to stay set for the platform code
to work: 
http://lxr.free-electrons.com/source/arch/powerpc/platforms/44x/ppc44x_simple.c#L43

So not sure why setting this to "meraki,ikarem" would be the best plan
of action, as then patches would be needed for the above code, and
possibly more drivers. (still new to the ppc arch and dts files, so
please correct me if I am wrong here).


> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [RFC 2/2] Add support for the Meraki MR24

2016-04-01 Thread Imre Kaloz
On Fri, 01 Apr 2016 03:46:10 +0200, Chris Blake   
wrote:



This patch adds support for the Meraki MR24 Access point to the apm821xx
target. More info on the device can be found at
https://wiki.openwrt.org/toh/meraki/mr24

Signed-off-by: Chris Blake 



--- /dev/null
+++ b/target/linux/apm821xx/dts/MR24.dts
@@ -0,0 +1,433 @@
+/*
+ * Device Tree Source for Meraki MR24 (Ikarem)
+ *
+ * Copyright (C) 2016 Chris Blake 
+ *
+ * Based on Cisco Meraki GPL Release r23-20150601 MR24 DTS
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2.  This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/ {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   model = "Meraki MR24 Access Point";
+   compatible = "apm,bluestone";


This should be "meraki,ikarem" if that's the codename for the box.

diff --git  
a/target/linux/apm821xx/patches-4.4/700-powerpc_ibm_phy_add_ar8035.patch  
b/target/linux/apm821xx/patches-4.4/700-powerpc_ibm_phy_add_ar8035.patch


diff --git  
a/target/linux/apm821xx/patches-4.4/800-ppc4xx-rng-fix-crash-during-init.patch  
b/target/linux/apm821xx/patches-4.4/800-ppc4xx-rng-fix-crash-during-init.patch


These should be part of "1/2".


Thanks,

Imre
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [RFC 2/2] Add support for the Meraki MR24

2016-03-31 Thread Chris Blake
This patch adds support for the Meraki MR24 Access point to the apm821xx
target. More info on the device can be found at
https://wiki.openwrt.org/toh/meraki/mr24

Signed-off-by: Chris Blake 
---
 .../linux/apm821xx/base-files/etc/board.d/01_leds  |  25 ++
 .../apm821xx/base-files/etc/board.d/02_network |   5 +-
 target/linux/apm821xx/base-files/etc/diag.sh   |  37 ++
 target/linux/apm821xx/base-files/lib/apm821xx.sh   |  39 ++
 .../lib/preinit/05_set_iface_mac_apm821xx  |  17 +
 .../apm821xx/base-files/lib/upgrade/merakinand.sh  |  65 
 .../apm821xx/base-files/lib/upgrade/platform.sh|  55 +++
 target/linux/apm821xx/dts/MR24.dts | 433 +
 target/linux/apm821xx/image/Makefile   |  57 +++
 .../700-powerpc_ibm_phy_add_ar8035.patch   |  41 ++
 .../800-ppc4xx-rng-fix-crash-during-init.patch | 117 ++
 target/linux/apm821xx/profiles/meraki.mk   |  17 +
 tools/firmware-utils/src/mkmerakifw.c  |  10 +
 13 files changed, 917 insertions(+), 1 deletion(-)
 create mode 100755 target/linux/apm821xx/base-files/etc/board.d/01_leds
 create mode 100755 target/linux/apm821xx/base-files/etc/diag.sh
 create mode 100755 target/linux/apm821xx/base-files/lib/apm821xx.sh
 create mode 100644 
target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx
 create mode 100755 target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh
 create mode 100755 target/linux/apm821xx/base-files/lib/upgrade/platform.sh
 create mode 100644 target/linux/apm821xx/dts/MR24.dts
 create mode 100644 
target/linux/apm821xx/patches-4.4/700-powerpc_ibm_phy_add_ar8035.patch
 create mode 100644 
target/linux/apm821xx/patches-4.4/800-ppc4xx-rng-fix-crash-during-init.patch
 create mode 100644 target/linux/apm821xx/profiles/meraki.mk

diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds 
b/target/linux/apm821xx/base-files/etc/board.d/01_leds
new file mode 100755
index 000..a94871f
--- /dev/null
+++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds
@@ -0,0 +1,25 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+
+. /lib/functions/uci-defaults.sh
+. /lib/apm821xx.sh
+
+board_config_update
+
+board=$(apm821xx_board_name)
+
+case "$board" in
+mr24)
+   ucidef_set_led_netdev "wan" "WAN" "mr24:green:wan" "eth0"
+   ucidef_set_led_wlan "wlan1" "WLAN1" "mr24:green:wifi1" "phy0assoc"
+   ucidef_set_led_wlan "wlan2" "WLAN2" "mr24:green:wifi2" "phy0assoc"
+   ucidef_set_led_wlan "wlan3" "WLAN3" "mr24:green:wifi3" "phy0assoc"
+   ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt"
+   ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network 
b/target/linux/apm821xx/base-files/etc/board.d/02_network
index a4e5ab4..9738b4e 100755
--- a/target/linux/apm821xx/base-files/etc/board.d/02_network
+++ b/target/linux/apm821xx/base-files/etc/board.d/02_network
@@ -11,7 +11,10 @@ board_config_update
 
 board=$(apm821xx_board_name)
 
-case "$board" 
+case "$board" in
+mr24)
+   ucidef_set_interface_lan "eth0"
+   ;;
 *)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
diff --git a/target/linux/apm821xx/base-files/etc/diag.sh 
b/target/linux/apm821xx/base-files/etc/diag.sh
new file mode 100755
index 000..787d0e1
--- /dev/null
+++ b/target/linux/apm821xx/base-files/etc/diag.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+
+. /lib/functions/leds.sh
+. /lib/apm821xx.sh
+
+get_status_led() {
+case $(apm821xx_board_name) in
+mr24)
+status_led="mr24:green:power"
+;;
+esac
+}
+
+set_state() {
+   get_status_led
+
+   case "$1" in
+   preinit)
+   status_led_blink_preinit
+   ;;
+
+   failsafe)
+   status_led_blink_failsafe
+   ;;
+
+   preinit_regular)
+   status_led_blink_preinit_regular
+   ;;
+
+   done)
+   status_led_on
+   ;;
+   esac
+}
diff --git a/target/linux/apm821xx/base-files/lib/apm821xx.sh 
b/target/linux/apm821xx/base-files/lib/apm821xx.sh
new file mode 100755
index 000..cfb1536
--- /dev/null
+++ b/target/linux/apm821xx/base-files/lib/apm821xx.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Copyright (C) 2016 OpenWrt.org
+#
+
+APM821XX_BOARD_NAME=
+APM821XX_MODEL=
+
+apm821xx_board_detect() {
+   local model
+   local name
+
+   model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo)
+
+   case "$model" in
+   *"Meraki MR24 Access Point")
+   name="mr24"
+   ;;
+   esac
+
+   [ -z "$name" ] && name="unknown"
+
+   [ -z "$APM821XX_BOARD_NAME" ] && APM821XX_BOARD_NAME="$name"
+   [ -z "$APM821XX_MODEL" ] && APM821XX_MODEL="$model"
+
+   [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+
+   echo "$APM821XX_BOARD_NAME" >