<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div>This patch is to add support for the Meraki MR12 and MR16 Access Points. Currently everything is working, minus the 2nd NIC interface on the MR12 which is built into the SoC.</div><div><br></div><div>Signed-off-by: Chris R Blake <<a href="mailto:chrisrblake93@gmail.com" target="_blank">chrisrblake93@gmail.com</a>></div><div><br></div><div>---</div><div><br></div><div>diff -Naur ./a/target/linux/ar71xx/base-files/etc/diag.sh ./b/target/linux/ar71xx/base-files/etc/diag.sh</div><div>--- ./a/target/linux/ar71xx/base-files/etc/diag.sh<span style="white-space:pre-wrap">        </span>2015-05-09 09:46:44.416000000 -0500</div><div>+++ ./b/target/linux/ar71xx/base-files/etc/diag.sh<span style="white-space:pre-wrap">    </span>2015-05-09 09:57:42.356000000 -0500</div><div>@@ -109,6 +109,12 @@</div><div> <span style="white-space:pre-wrap"> </span>mc-mac1200r)</div><div> <span style="white-space:pre-wrap">           </span>status_led="mercury:green:system"</div><div> <span style="white-space:pre-wrap">            </span>;;</div><div>+<span style="white-space:pre-wrap">      </span>mr12)</div><div>+<span style="white-space:pre-wrap">           </span>status_led="mr12:green:power"</div><div>+<span style="white-space:pre-wrap">         </span>;;</div><div>+<span style="white-space:pre-wrap">      </span>mr16)</div><div>+<span style="white-space:pre-wrap">           </span>status_led="mr16:green:power"</div><div>+<span style="white-space:pre-wrap">         </span>;;</div><div> <span style="white-space:pre-wrap">     </span>mr600)</div><div> <span style="white-space:pre-wrap">         </span>status_led="mr600:orange:power"</div><div> <span style="white-space:pre-wrap">              </span>;;</div><div>diff -Naur ./a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds ./b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds</div><div>--- ./a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds<span style="white-space:pre-wrap">       </span>2015-05-09 09:46:44.416000000 -0500</div><div>+++ ./b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds<span style="white-space:pre-wrap">       </span>2015-05-09 09:57:42.356000000 -0500</div><div>@@ -178,6 +178,22 @@</div><div> <span style="white-space:pre-wrap"> </span>ucidef_set_led_wlan "wlan5g" "WLAN5G" "mercury:green:wlan5g" "phy0tpt"</div><div> <span style="white-space:pre-wrap"> </span>;;</div><div> </div><div>+mr12)</div><div>+<span style="white-space:pre-wrap">        </span>ucidef_set_led_netdev "wan" "WAN" "mr12:green:wan" "eth0"</div><div>+<span style="white-space:pre-wrap">       </span>ucidef_set_led_wlan "wlan1" "WLAN1" "mr12:green:wifi1" "phy0assoc"</div><div>+<span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan2" "WLAN2" "mr12:green:wifi2" "phy0assoc"</div><div>+<span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan3" "WLAN3" "mr12:green:wifi3" "phy0assoc"</div><div>+<span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan4" "WLAN4" "mr12:green:wifi4" "phy0tpt"</div><div>+<span style="white-space:pre-wrap">        </span>;;</div><div>+</div><div>+mr16)</div><div>+<span style="white-space:pre-wrap"> </span>ucidef_set_led_netdev "wan" "WAN" "mr16:green:wan" "eth0"</div><div>+<span style="white-space:pre-wrap">       </span>ucidef_set_led_wlan "wlan1" "WLAN1" "mr16:green:wifi1" "phy0assoc"</div><div>+<span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan2" "WLAN2" "mr16:green:wifi2" "phy0assoc"</div><div>+<span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan3" "WLAN3" "mr16:green:wifi3" "phy0assoc"</div><div>+<span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan4" "WLAN4" "mr16:green:wifi4" "phy0tpt"</div><div>+<span style="white-space:pre-wrap">        </span>;;</div><div>+</div><div> mr600)</div><div> <span style="white-space:pre-wrap">      </span>ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt"</div><div> <span style="white-space:pre-wrap">   </span>;;</div><div>diff -Naur ./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</div><div>--- ./a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration<span style="white-space:pre-wrap">        </span>2015-05-09 09:46:44.416000000 -0500</div><div>+++ ./b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration<span style="white-space:pre-wrap">  </span>2015-05-09 09:57:42.356000000 -0500</div><div>@@ -61,6 +61,8 @@</div><div> dir-615-e1|\</div><div> dir-615-e4|\</div><div> ja76pf|\</div><div>+mr-12|\</div><div>+mr-16|\</div><div> rb-750|\</div><div> rb-751|\</div><div> tew-632brp|\</div><div>diff -Naur ./a/target/linux/ar71xx/base-files/lib/ar71xx.sh ./b/target/linux/ar71xx/base-files/lib/ar71xx.sh</div><div>--- ./a/target/linux/ar71xx/base-files/lib/ar71xx.sh<span style="white-space:pre-wrap">       </span>2015-05-09 09:46:44.416000000 -0500</div><div>+++ ./b/target/linux/ar71xx/base-files/lib/ar71xx.sh<span style="white-space:pre-wrap">  </span>2015-05-09 09:57:42.360000000 -0500</div><div>@@ -471,6 +471,12 @@</div><div> <span style="white-space:pre-wrap"> </span>*"MAC1200R")</div><div> <span style="white-space:pre-wrap">         </span>name="mc-mac1200r"</div><div> <span style="white-space:pre-wrap">           </span>;;</div><div>+<span style="white-space:pre-wrap">      </span>*MR12)</div><div>+<span style="white-space:pre-wrap">          </span>name="mr12"</div><div>+<span style="white-space:pre-wrap">           </span>;;</div><div>+<span style="white-space:pre-wrap">      </span>*MR16)</div><div>+<span style="white-space:pre-wrap">          </span>name="mr16"</div><div>+<span style="white-space:pre-wrap">           </span>;;</div><div> <span style="white-space:pre-wrap">     </span>*MR600v2)</div><div> <span style="white-space:pre-wrap">              </span>name="mr600v2"</div><div> <span style="white-space:pre-wrap">               </span>;;</div><div>diff -Naur ./a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh ./b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh</div><div>--- ./a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh<span style="white-space:pre-wrap">  </span>2015-05-09 09:46:44.416000000 -0500</div><div>+++ ./b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh<span style="white-space:pre-wrap">        </span>2015-05-09 09:57:42.360000000 -0500</div><div>@@ -184,6 +184,8 @@</div><div> <span style="white-space:pre-wrap">  </span>db120 | \</div><div> <span style="white-space:pre-wrap">      </span>f9k1115v2 |\</div><div> <span style="white-space:pre-wrap">   </span>hornet-ub | \</div><div>+<span style="white-space:pre-wrap">   </span>mr12 | \</div><div>+<span style="white-space:pre-wrap">        </span>mr16 | \</div><div> <span style="white-space:pre-wrap">       </span>wpj558 | \</div><div> <span style="white-space:pre-wrap">     </span>zcn-1523h-2 | \</div><div> <span style="white-space:pre-wrap">        </span>zcn-1523h-5)</div><div>diff -Naur ./a/target/linux/ar71xx/config-3.18 ./b/target/linux/ar71xx/config-3.18</div><div>--- ./a/target/linux/ar71xx/config-3.18<span style="white-space:pre-wrap">     </span>2015-05-09 09:46:44.416000000 -0500</div><div>+++ ./b/target/linux/ar71xx/config-3.18<span style="white-space:pre-wrap">       </span>2015-05-09 09:57:42.360000000 -0500</div><div>@@ -68,6 +68,8 @@</div><div> CONFIG_ATH79_MACH_JA76PF=y</div><div> CONFIG_ATH79_MACH_JWAP003=y</div><div> CONFIG_ATH79_MACH_MC_MAC1200R=y</div><div>+CONFIG_ATH79_MACH_MR16=y</div><div>+CONFIG_ATH79_MACH_MR12=y</div><div> CONFIG_ATH79_MACH_MR600=y</div><div> CONFIG_ATH79_MACH_MR900=y</div><div> CONFIG_ATH79_MACH_MYNET_N600=y</div><div>diff -Naur ./a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c ./b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c</div><div>--- ./a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c<span style="white-space:pre-wrap">  </span>1969-12-31 18:00:00.000000000 -0600</div><div>+++ ./b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c<span style="white-space:pre-wrap"> </span>2015-05-09 09:57:42.364000000 -0500</div><div>@@ -0,0 +1,115 @@</div><div>+/*</div><div>+ *  Cisco Meraki MR12 board support</div><div>+ *</div><div>+ *  Copyright (C) 2014-2015 Chris Blake <<a href="mailto:chrisrblake93@gmail.com" target="_blank">chrisrblake93@gmail.com</a>></div><div>+ *</div><div>+ *  Based on Atheros AP96 board support configuration</div><div>+ *</div><div>+ *  Copyright (C) 2009 Marco Porsch</div><div>+ *  Copyright (C) 2009-2012 Gabor Juhos <<a href="mailto:juhosg@openwrt.org" target="_blank">juhosg@openwrt.org</a>></div><div>+ *  Copyright (C) 2010 Atheros Communications</div><div>+ *</div><div>+ *  This program is free software; you can redistribute it and/or modify it</div><div>+ *  under the terms of the GNU General Public License version 2 as published</div><div>+ *  by the Free Software Foundation.</div><div>+ */</div><div>+</div><div>+#include <linux/platform_device.h></div><div>+#include <linux/delay.h></div><div>+</div><div>+#include <asm/mach-ath79/ath79.h></div><div>+</div><div>+#include "dev-ap9x-pci.h"</div><div>+#include "dev-eth.h"</div><div>+#include "dev-gpio-buttons.h"</div><div>+#include "dev-leds-gpio.h"</div><div>+#include "dev-m25p80.h"</div><div>+#include "machtypes.h"</div><div>+</div><div>+#define MR12_GPIO_LED_W4_GREEN<span style="white-space:pre-wrap">              </span>14</div><div>+#define MR12_GPIO_LED_W3_GREEN<span style="white-space:pre-wrap">                </span>13</div><div>+#define MR12_GPIO_LED_W2_GREEN<span style="white-space:pre-wrap">                </span>12</div><div>+#define MR12_GPIO_LED_W1_GREEN<span style="white-space:pre-wrap">                </span>11</div><div>+</div><div>+#define MR12_GPIO_LED_WAN<span style="white-space:pre-wrap">             </span>15</div><div>+</div><div>+#define MR12_GPIO_LED_POWER_ORANGE<span style="white-space:pre-wrap">            </span>16</div><div>+#define MR12_GPIO_LED_POWER_GREEN<span style="white-space:pre-wrap">             </span>17</div><div>+</div><div>+#define MR12_GPIO_BTN_RESET<span style="white-space:pre-wrap">           </span>8</div><div>+#define MR12_KEYS_POLL_INTERVAL<span style="white-space:pre-wrap">                </span>20<span style="white-space:pre-wrap">      </span>/* msecs */</div><div>+#define MR12_KEYS_DEBOUNCE_INTERVAL<span style="white-space:pre-wrap">  </span>(3 * MR12_KEYS_POLL_INTERVAL)</div><div>+</div><div>+#define MR12_WAN_PHYMASK    BIT(4)</div><div>+</div><div>+#define MR12_WMAC0_MAC_OFFSET           0x120c</div><div>+#define MR12_CALDATA0_OFFSET            0x1000</div><div>+</div><div>+static struct gpio_led MR12_leds_gpio[] __initdata = {</div><div>+<span style="white-space:pre-wrap">  </span>{</div><div>+<span style="white-space:pre-wrap">               </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:green:wan",</div><div>+<span style="white-space:pre-wrap">           </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_WAN,</div><div>+<span style="white-space:pre-wrap">            </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:orange:power",</div><div>+<span style="white-space:pre-wrap">                </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_POWER_ORANGE,</div><div>+<span style="white-space:pre-wrap">           </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:green:power",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_POWER_GREEN,</div><div>+<span style="white-space:pre-wrap">            </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:green:wifi4",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_W4_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:green:wifi3",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_W3_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:green:wifi2",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_W2_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr12:green:wifi1",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_LED_W1_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}</div><div>+};</div><div>+</div><div>+static struct gpio_keys_button MR12_gpio_keys[] __initdata = {</div><div>+<span style="white-space:pre-wrap">       </span>{</div><div>+<span style="white-space:pre-wrap">               </span>.desc<span style="white-space:pre-wrap">           </span>= "reset",</div><div>+<span style="white-space:pre-wrap">            </span>.type<span style="white-space:pre-wrap">           </span>= EV_KEY,</div><div>+<span style="white-space:pre-wrap">               </span>.code<span style="white-space:pre-wrap">           </span>= KEY_RESTART,</div><div>+<span style="white-space:pre-wrap">          </span>.debounce_interval = MR12_KEYS_DEBOUNCE_INTERVAL,</div><div>+<span style="white-space:pre-wrap">               </span>.gpio<span style="white-space:pre-wrap">           </span>= MR12_GPIO_BTN_RESET,</div><div>+<span style="white-space:pre-wrap">          </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}</div><div>+};</div><div>+</div><div>+static void __init MR12_setup(void)</div><div>+{</div><div>+<span style="white-space:pre-wrap"> </span>u8 *mac = (u8 *) KSEG1ADDR(0xbfff0000);</div><div>+<span style="white-space:pre-wrap"> </span></div><div>+<span style="white-space:pre-wrap">        </span>ath79_register_mdio(0,0x0);</div><div>+</div><div>+<span style="white-space:pre-wrap">     </span>ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);</div><div>+<span style="white-space:pre-wrap">       </span>ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;</div><div>+<span style="white-space:pre-wrap"> </span>ath79_eth0_data.phy_mask = MR12_WAN_PHYMASK;</div><div>+<span style="white-space:pre-wrap">    </span>ath79_register_eth(0);</div><div>+</div><div>+<span style="white-space:pre-wrap">  </span>ath79_register_m25p80(NULL);</div><div>+</div><div>+<span style="white-space:pre-wrap">    </span>ath79_register_leds_gpio(-1, ARRAY_SIZE(MR12_leds_gpio),</div><div>+<span style="white-space:pre-wrap">                                        </span>MR12_leds_gpio);</div><div>+<span style="white-space:pre-wrap">        </span>ath79_register_gpio_keys_polled(-1, MR12_KEYS_POLL_INTERVAL,</div><div>+<span style="white-space:pre-wrap">                                    </span>ARRAY_SIZE(MR12_gpio_keys),</div><div>+<span style="white-space:pre-wrap">                                     </span>MR12_gpio_keys);</div><div>+</div><div>+<span style="white-space:pre-wrap">        </span>ap91_pci_init(mac + MR12_CALDATA0_OFFSET,</div><div>+<span style="white-space:pre-wrap">                               </span>mac + MR12_WMAC0_MAC_OFFSET);</div><div>+</div><div>+}</div><div>+</div><div>+MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup);</div><div>\ No newline at end of file</div><div>diff -Naur ./a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c ./b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c</div><div>--- ./a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c<span style="white-space:pre-wrap">  </span>1969-12-31 18:00:00.000000000 -0600</div><div>+++ ./b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c<span style="white-space:pre-wrap"> </span>2015-05-09 09:57:42.364000000 -0500</div><div>@@ -0,0 +1,118 @@</div><div>+/*</div><div>+ *  Cisco Meraki MR16 board support</div><div>+ *</div><div>+ *  Copyright (C) 2015 Chris Blake <<a href="mailto:chrisrblake93@gmail.com" target="_blank">chrisrblake93@gmail.com</a>></div><div>+ *</div><div>+ *  Based on Atheros AP96 board support configuration</div><div>+ *</div><div>+ *  Copyright (C) 2009 Marco Porsch</div><div>+ *  Copyright (C) 2009-2012 Gabor Juhos <<a href="mailto:juhosg@openwrt.org" target="_blank">juhosg@openwrt.org</a>></div><div>+ *  Copyright (C) 2010 Atheros Communications</div><div>+ *</div><div>+ *  This program is free software; you can redistribute it and/or modify it</div><div>+ *  under the terms of the GNU General Public License version 2 as published</div><div>+ *  by the Free Software Foundation.</div><div>+ */</div><div>+</div><div>+#include <linux/platform_device.h></div><div>+#include <linux/delay.h></div><div>+</div><div>+#include <asm/mach-ath79/ath79.h></div><div>+</div><div>+#include "dev-ap9x-pci.h"</div><div>+#include "dev-eth.h"</div><div>+#include "dev-gpio-buttons.h"</div><div>+#include "dev-leds-gpio.h"</div><div>+#include "dev-m25p80.h"</div><div>+#include "machtypes.h"</div><div>+</div><div>+#define MR16_GPIO_LED_W4_GREEN<span style="white-space:pre-wrap">           </span>3</div><div>+#define MR16_GPIO_LED_W3_GREEN<span style="white-space:pre-wrap">         </span>2</div><div>+#define MR16_GPIO_LED_W2_GREEN<span style="white-space:pre-wrap">         </span>1</div><div>+#define MR16_GPIO_LED_W1_GREEN<span style="white-space:pre-wrap">         </span>0</div><div>+</div><div>+#define MR16_GPIO_LED_WAN<span style="white-space:pre-wrap">              </span>4</div><div>+</div><div>+#define MR16_GPIO_LED_POWER_ORANGE<span style="white-space:pre-wrap">             </span>5</div><div>+#define MR16_GPIO_LED_POWER_GREEN<span style="white-space:pre-wrap">              </span>6</div><div>+</div><div>+#define MR16_GPIO_BTN_RESET<span style="white-space:pre-wrap">            </span>7</div><div>+#define MR16_KEYS_POLL_INTERVAL<span style="white-space:pre-wrap">                </span>20<span style="white-space:pre-wrap">      </span>/* msecs */</div><div>+#define MR16_KEYS_DEBOUNCE_INTERVAL<span style="white-space:pre-wrap">  </span>(3 * MR16_KEYS_POLL_INTERVAL)</div><div>+</div><div>+#define MR16_WAN_PHYMASK    BIT(0)</div><div>+</div><div>+#define MR16_WMAC0_MAC_OFFSET<span style="white-space:pre-wrap">          </span>0x120c</div><div>+#define MR16_WMAC1_MAC_OFFSET<span style="white-space:pre-wrap">             </span>0x520c</div><div>+#define MR16_CALDATA0_OFFSET<span style="white-space:pre-wrap">              </span>0x1000</div><div>+#define MR16_CALDATA1_OFFSET<span style="white-space:pre-wrap">              </span>0x5000</div><div>+</div><div>+static struct gpio_led MR16_leds_gpio[] __initdata = {</div><div>+<span style="white-space:pre-wrap">    </span>{</div><div>+<span style="white-space:pre-wrap">               </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:green:wan",</div><div>+<span style="white-space:pre-wrap">           </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_WAN,</div><div>+<span style="white-space:pre-wrap">            </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:orange:power",</div><div>+<span style="white-space:pre-wrap">                </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_POWER_ORANGE,</div><div>+<span style="white-space:pre-wrap">           </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:green:power",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_POWER_GREEN,</div><div>+<span style="white-space:pre-wrap">            </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:green:wifi4",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_W4_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:green:wifi3",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_W3_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:green:wifi2",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_W2_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}, {</div><div>+<span style="white-space:pre-wrap">            </span>.name<span style="white-space:pre-wrap">           </span>= "mr16:green:wifi1",</div><div>+<span style="white-space:pre-wrap">         </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_LED_W1_GREEN,</div><div>+<span style="white-space:pre-wrap">               </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}</div><div>+};</div><div>+</div><div>+static struct gpio_keys_button MR16_gpio_keys[] __initdata = {</div><div>+<span style="white-space:pre-wrap">       </span>{</div><div>+<span style="white-space:pre-wrap">               </span>.desc<span style="white-space:pre-wrap">           </span>= "reset",</div><div>+<span style="white-space:pre-wrap">            </span>.type<span style="white-space:pre-wrap">           </span>= EV_KEY,</div><div>+<span style="white-space:pre-wrap">               </span>.code<span style="white-space:pre-wrap">           </span>= KEY_RESTART,</div><div>+<span style="white-space:pre-wrap">          </span>.debounce_interval = MR16_KEYS_DEBOUNCE_INTERVAL,</div><div>+<span style="white-space:pre-wrap">               </span>.gpio<span style="white-space:pre-wrap">           </span>= MR16_GPIO_BTN_RESET,</div><div>+<span style="white-space:pre-wrap">          </span>.active_low<span style="white-space:pre-wrap">     </span>= 1,</div><div>+<span style="white-space:pre-wrap">    </span>}</div><div>+};</div><div>+</div><div>+static void __init MR16_setup(void)</div><div>+{</div><div>+<span style="white-space:pre-wrap"> </span>u8 *mac = (u8 *) KSEG1ADDR(0xbfff0000);</div><div>+<span style="white-space:pre-wrap"> </span></div><div>+<span style="white-space:pre-wrap">        </span>ath79_register_mdio(0,0x0);</div><div>+</div><div>+<span style="white-space:pre-wrap">     </span>ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0);</div><div>+<span style="white-space:pre-wrap">       </span>ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;</div><div>+<span style="white-space:pre-wrap"> </span>ath79_eth0_data.phy_mask = MR16_WAN_PHYMASK;</div><div>+<span style="white-space:pre-wrap">    </span>ath79_register_eth(0);</div><div>+</div><div>+<span style="white-space:pre-wrap">  </span>ath79_register_m25p80(NULL);</div><div>+</div><div>+<span style="white-space:pre-wrap">    </span>ath79_register_leds_gpio(-1, ARRAY_SIZE(MR16_leds_gpio),</div><div>+<span style="white-space:pre-wrap">                                        </span>MR16_leds_gpio);</div><div>+<span style="white-space:pre-wrap">        </span>ath79_register_gpio_keys_polled(-1, MR16_KEYS_POLL_INTERVAL,</div><div>+<span style="white-space:pre-wrap">                                    </span>ARRAY_SIZE(MR16_gpio_keys),</div><div>+<span style="white-space:pre-wrap">                                     </span>MR16_gpio_keys);</div><div>+</div><div>+<span style="white-space:pre-wrap">        </span>ap94_pci_init(mac + MR16_CALDATA0_OFFSET,</div><div>+<span style="white-space:pre-wrap">               </span>    mac + MR16_WMAC0_MAC_OFFSET,</div><div>+<span style="white-space:pre-wrap">              </span>    mac + MR16_CALDATA1_OFFSET,</div><div>+<span style="white-space:pre-wrap">               </span>    mac + MR16_WMAC1_MAC_OFFSET);</div><div>+}</div><div>+</div><div>+MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup);</div><div>\ No newline at end of file</div><div>diff -Naur ./a/target/linux/ar71xx/generic/profiles/<a href="http://meraki.mk" target="_blank">meraki.mk</a> ./b/target/linux/ar71xx/generic/profiles/<a href="http://meraki.mk" target="_blank">meraki.mk</a></div><div>--- ./a/target/linux/ar71xx/generic/profiles/<a href="http://meraki.mk" target="_blank">meraki.mk</a><span style="white-space:pre-wrap">    </span>1969-12-31 18:00:00.000000000 -0600</div><div>+++ ./b/target/linux/ar71xx/generic/profiles/<a href="http://meraki.mk" target="_blank">meraki.mk</a><span style="white-space:pre-wrap"> </span>2015-05-09 09:57:42.372000000 -0500</div><div>@@ -0,0 +1,27 @@</div><div>+#</div><div>+# Copyright (C) 2014-2015 Chris Blake (<a href="mailto:chrisrblake93@gmail.com" target="_blank">chrisrblake93@gmail.com</a>)</div><div>+#</div><div>+# This is free software, licensed under the GNU General Public License v2.</div><div>+# See /LICENSE for more information.</div><div>+#</div><div>+</div><div>+define Profile/MR12</div><div>+<span style="white-space:pre-wrap">      </span>NAME:=Meraki MR12</div><div>+<span style="white-space:pre-wrap">       </span>PACKAGES:=kmod-spi-gpio kmod-ath9k</div><div>+endef</div><div>+</div><div>+define Profile/MR12/description</div><div>+<span style="white-space:pre-wrap">  </span>Package set optimized for the Cisco Meraki MR12 Access Point.</div><div>+endef</div><div>+</div><div>+define Profile/MR16</div><div>+<span style="white-space:pre-wrap">   </span>NAME:=Meraki MR16</div><div>+<span style="white-space:pre-wrap">       </span>PACKAGES:=kmod-spi-gpio kmod-ath9k</div><div>+endef</div><div>+</div><div>+define Profile/MR16/description</div><div>+<span style="white-space:pre-wrap">  </span>Package set optimized for the Cisco Meraki MR16 Access Point.</div><div>+endef</div><div>+</div><div>+$(eval $(call Profile,MR12))</div><div>+$(eval $(call Profile,MR16))</div><div>\ No newline at end of file</div><div>diff -Naur ./a/target/linux/ar71xx/image/Makefile ./b/target/linux/ar71xx/image/Makefile</div><div>--- ./a/target/linux/ar71xx/image/Makefile<span style="white-space:pre-wrap">    </span>2015-05-09 09:46:44.432000000 -0500</div><div>+++ ./b/target/linux/ar71xx/image/Makefile<span style="white-space:pre-wrap">    </span>2015-05-09 09:57:42.372000000 -0500</div><div>@@ -833,6 +833,8 @@</div><div> dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig)</div><div> dragino2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,16000k(firmware),64k(config)ro,64k(art)ro</div><div> hiwifi_hc6361_mtdlayout=mtdparts=spi0.0:64k(u-boot)ro,64k(bdinfo)ro,1280k(kernel),14848k(rootfs),64k(backup)ro,64k(art)ro,16128k@0x20000(firmware)</div><div>+mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)</div><div>+mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x80000(firmware)</div><div> pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x50000(firmware)</div><div> planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro</div><div> ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro</div><div>@@ -1710,6 +1712,8 @@</div><div> $(eval $(call SingleProfile,AthLzma,64k,EWDORINRT,ew-dorin-router,EW-DORIN-ROUTER,ttyATH0,115200,$$(ew-dorin_mtdlayout_4M),KRuImage,65536))</div><div> $(eval $(call SingleProfile,AthLzma,64k,EWDORIN16M,ew-dorin-16M,EW-DORIN,ttyATH0,115200,$$(ew-dorin_mtdlayout_16M),KRuImage,65536))</div><div> $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))</div><div>+$(eval $(call SingleProfile,AthLzma,64k,MR12,mr12,MR12,ttyS0,115200,$$(mr12_mtdlayout),RKuImage))</div><div>+$(eval $(call SingleProfile,AthLzma,64k,MR16,mr16,MR16,ttyS0,115200,$$(mr16_mtdlayout),RKuImage))</div><div> $(eval $(call SingleProfile,AthLzma,64k,PB92,pb92,PB92,ttyS0,115200,$$(pb92_mtdlayout),KRuImage))</div><div> $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536))</div><div> $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage))</div><div>diff -Naur ./a/target/linux/ar71xx/patches-3.18/738-MIPS-ath79-add-meraki-mr12-mr16-support.patch ./b/target/linux/ar71xx/patches-3.18/738-MIPS-ath79-add-meraki-mr12-mr16-support.patch</div><div>--- ./a/target/linux/ar71xx/patches-3.18/738-MIPS-ath79-add-meraki-mr12-mr16-support.patch<span style="white-space:pre-wrap">      </span>1969-12-31 18:00:00.000000000 -0600</div><div>+++ ./b/target/linux/ar71xx/patches-3.18/738-MIPS-ath79-add-meraki-mr12-mr16-support.patch<span style="white-space:pre-wrap">    </span>2015-05-09 09:57:42.380000000 -0500</div><div>@@ -0,0 +1,51 @@</div><div>+--- a/arch/mips/ath79/Kconfig</div><div>++++ b/arch/mips/ath79/Kconfig</div><div>+@@ -694,6 +694,26 @@ config ATH79_MACH_OM5P</div><div>+ <span style="white-space:pre-wrap">        </span>select ATH79_DEV_M25P80</div><div>+ <span style="white-space:pre-wrap">        </span>select ATH79_DEV_WMAC</div><div>+ </div><div>++config ATH79_MACH_MR12</div><div>++<span style="white-space:pre-wrap"> </span>bool "Meraki MR12 board support"</div><div>++<span style="white-space:pre-wrap">     </span>select SOC_AR724X</div><div>++<span style="white-space:pre-wrap">      </span>select ATH79_DEV_AP9X_PCI if PCI</div><div>++<span style="white-space:pre-wrap">       </span>select ATH79_DEV_ETH</div><div>++<span style="white-space:pre-wrap">   </span>select ATH79_DEV_GPIO_BUTTONS</div><div>++<span style="white-space:pre-wrap">  </span>select ATH79_DEV_LEDS_GPIO</div><div>++<span style="white-space:pre-wrap">     </span>select ATH79_DEV_M25P80</div><div>++<span style="white-space:pre-wrap">        </span>select ATH79_DEV_WMAC</div><div>++</div><div>++config ATH79_MACH_MR16</div><div>++<span style="white-space:pre-wrap">  </span>bool "Meraki MR16 board support"</div><div>++<span style="white-space:pre-wrap">     </span>select SOC_AR71XX</div><div>++<span style="white-space:pre-wrap">      </span>select ATH79_DEV_AP9X_PCI if PCI</div><div>++<span style="white-space:pre-wrap">       </span>select ATH79_DEV_ETH</div><div>++<span style="white-space:pre-wrap">   </span>select ATH79_DEV_GPIO_BUTTONS</div><div>++<span style="white-space:pre-wrap">  </span>select ATH79_DEV_LEDS_GPIO</div><div>++<span style="white-space:pre-wrap">     </span>select ATH79_DEV_M25P80</div><div>++<span style="white-space:pre-wrap">        </span>select ATH79_DEV_WMAC</div><div>++</div><div>+ config ATH79_MACH_MR600</div><div>+ <span style="white-space:pre-wrap"> </span>bool "OpenMesh MR600 board support"</div><div>+ <span style="white-space:pre-wrap">  </span>select SOC_AR934X</div><div>+--- a/arch/mips/ath79/Makefile</div><div>++++ b/arch/mips/ath79/Makefile</div><div>+@@ -78,6 +78,8 @@ obj-$(CONFIG_ATH79_MACH_JA76PF)<span style="white-space:pre-wrap">  </span>+</div><div>+ obj-$(CONFIG_ATH79_MACH_JWAP003)<span style="white-space:pre-wrap">      </span>+= mach-jwap003.o</div><div>+ obj-$(CONFIG_ATH79_MACH_HORNET_UB)<span style="white-space:pre-wrap">    </span>+= mach-hornet-ub.o</div><div>+ obj-$(CONFIG_ATH79_MACH_MC_MAC1200R)     += mach-mc-mac1200r.o</div><div>++obj-$(CONFIG_ATH79_MACH_MR12)<span style="white-space:pre-wrap">              </span>+= mach-mr12.o</div><div>++obj-$(CONFIG_ATH79_MACH_MR16)<span style="white-space:pre-wrap">            </span>+= mach-mr16.o</div><div>+ obj-$(CONFIG_ATH79_MACH_MR600)<span style="white-space:pre-wrap">           </span>+= mach-mr600.o</div><div>+ obj-$(CONFIG_ATH79_MACH_MR900)<span style="white-space:pre-wrap">          </span>+= mach-mr900.o</div><div>+ obj-$(CONFIG_ATH79_MACH_MYNET_N600)<span style="white-space:pre-wrap">     </span>+= mach-mynet-n600.o</div><div>+--- a/arch/mips/ath79/machtypes.h</div><div>++++ b/arch/mips/ath79/machtypes.h</div><div>+@@ -67,6 +67,8 @@ enum ath79_mach_type {</div><div>+ <span style="white-space:pre-wrap"> </span>ATH79_MACH_JA76PF2,<span style="white-space:pre-wrap">             </span>/* jjPlus JA76PF2 */</div><div>+ <span style="white-space:pre-wrap">   </span>ATH79_MACH_JWAP003,<span style="white-space:pre-wrap">             </span>/* jjPlus JWAP003 */</div><div>+ <span style="white-space:pre-wrap">   </span>ATH79_MACH_HORNET_UB,<span style="white-space:pre-wrap">           </span>/* ALFA Networks Hornet-UB */</div><div>++<span style="white-space:pre-wrap">  </span>ATH79_MACH_MR12,<span style="white-space:pre-wrap">                </span>/* Cisco Meraki MR12 */</div><div>++<span style="white-space:pre-wrap">        </span>ATH79_MACH_MR16,<span style="white-space:pre-wrap">                </span>/* Cisco Meraki MR16 */</div><div>+ <span style="white-space:pre-wrap">        </span>ATH79_MACH_MR600V2,<span style="white-space:pre-wrap">             </span>/* OpenMesh MR600v2 */</div><div>+ <span style="white-space:pre-wrap"> </span>ATH79_MACH_MR600,<span style="white-space:pre-wrap">               </span>/* OpenMesh MR600 */</div><div>+ <span style="white-space:pre-wrap">   </span>ATH79_MACH_MR900,<span style="white-space:pre-wrap">               </span>/* OpenMesh MR900 */ </div><div><br></div></div>
</div><br></div>