Re: [OpenWrt-Devel] [PATCH] Add WeIO board (http://we-io.net) profile. This patch adds support for WeIO board, which is based on Carambola2 board from 8Devices.

2015-08-05 Thread Drasko DRASKOVIC
On Mon, Jul 27, 2015 at 4:10 AM, Karl Palsson ka...@tweak.net.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Just one more, I promise :)

 Drasko DRASKOVIC drasko.drasko...@gmail.com wrote:
 +
 +static void __init weio_common_setup(void)
 +{
 + u8 *art = (u8 *) KSEG1ADDR(0x1fff);
 +
 + ath79_register_m25p80(NULL);
 + ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
 + art + WEIO_WMAC_MAC_OFFSET);
 +
 +/** WeIO uses only WiFi by default (no ETH). If ETH jack is soldered, 
 uncomment following lines  */
 +#if 0
 + ath79_setup_ar933x_phy4_switch(true, true);
 +
 + ath79_init_mac(ath79_eth0_data.mac_addr, art + WEIO_MAC0_OFFSET, 0);
 + ath79_init_mac(ath79_eth1_data.mac_addr, art + WEIO_MAC1_OFFSET, 0);
 +
 + ath79_register_mdio(0, 0x0);
 +
 + /* LAN ports */
 + ath79_register_eth(1);
 +
 + /* WAN port */
 + ath79_register_eth(0);
 +#endif /** commented out ETH */
 +}
 +


 I still think this #ifdefed code should be removed.  None of the product
 literature on your site shows any way of this being added.  It's not
 like there is a two port ethernet footprint that's simply not mounted,
 you'd have to connect it to the breadboard headers on the side of the
 board, by the time someone's done that, it's not really the weio board
 anymore is it?

Patch re-sent with #ifdefs removed, as suggested.

I hope it is OK now.

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


Re: [OpenWrt-Devel] [PATCH] Add WeIO board (http://we-io.net) profile. This patch adds support for WeIO board, which is based on Carambola2 board from 8Devices.

2015-07-26 Thread Karl Palsson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Just one more, I promise :)

Drasko DRASKOVIC drasko.drasko...@gmail.com wrote:
 +
 +static void __init weio_common_setup(void)
 +{
 + u8 *art = (u8 *) KSEG1ADDR(0x1fff);
 +
 + ath79_register_m25p80(NULL);
 + ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
 + art + WEIO_WMAC_MAC_OFFSET);
 +
 +/** WeIO uses only WiFi by default (no ETH). If ETH jack is soldered, 
 uncomment following lines  */
 +#if 0
 + ath79_setup_ar933x_phy4_switch(true, true);
 +
 + ath79_init_mac(ath79_eth0_data.mac_addr, art + WEIO_MAC0_OFFSET, 0);
 + ath79_init_mac(ath79_eth1_data.mac_addr, art + WEIO_MAC1_OFFSET, 0);
 +
 + ath79_register_mdio(0, 0x0);
 +
 + /* LAN ports */
 + ath79_register_eth(1);
 +
 + /* WAN port */
 + ath79_register_eth(0);
 +#endif /** commented out ETH */
 +}
 +


I still think this #ifdefed code should be removed.  None of the product
literature on your site shows any way of this being added.  It's not
like there is a two port ethernet footprint that's simply not mounted,
you'd have to connect it to the breadboard headers on the side of the
board, by the time someone's done that, it's not really the weio board
anymore is it?

Cheers,
Karl P

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJVtZMXAAoJEBmotQ/U1cr2G6gQALxTf1xexyD9kGcjNDT21HCb
t2SjZEPVBEcIYe1RUShCRdAyUs3sgDNPXHoGO9W5i/XjgX0fUxn905hQnVubBRF8
CoOfaJbxoum0RYTF9cqXeGyQVPULGTYl79yQLJqNmnoBuXkDOSQ+dkFH9lcOcTVO
4pFYSD2tt1BX8IXokET/47kMkosYK0adkjzJvppG1EXvOaRUbeM9CVlyaN+BRih5
W0oFCLEnXQdlMCj8AmIMKkohZpBj69V9yXHZVYtRuKbLcJvG3CMAIp6DRqG/Z0YT
1dAdB5rkI86OjvDUPlpLYinFPazDJ6ibpyTWNWhZ/j7NcWU7beX1t3h6Uxfs/kbq
V8lzbx2QjreVTTceNi6zDCGCqkejVwV2qH2UIK7g4Lu5m5UiF+1ttbr8CoOxtPT+
adZrFOuVtAD8OsHyx9BKcxNvmUx+1+6YfhGw4dCrePyMfG1AxTHGv6i3yguA63Yf
7LYKA/SIwTCUJiKTdwON0VpRQwnvwSIqFTXp1iah5b8Jpxpu3a8LzjH396dOfYZ2
H3IXByuMpcHkR+sst3iqhPj9ge8O9Ssp2u59HFRYTPOt+e5MTjcQVKxIFGfNXH34
1iSVInuD3MlWfLDqAGeM8dZU3KXA+DYA3hvdarRqcePXS6MdLT6NJAZ9+p3ntw2c
WfBsXbyZhdpzmSSXjkru
=1Xp3
-END PGP SIGNATURE-
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] Add WeIO board (http://we-io.net) profile. This patch adds support for WeIO board, which is based on Carambola2 board from 8Devices.

2015-07-25 Thread Drasko DRASKOVIC
Signed-off-by: Drasko DRASKOVIC drasko.drasko...@gmail.com
---
 target/linux/ar71xx/base-files/lib/ar71xx.sh   |   3 +
 .../ar71xx/base-files/lib/upgrade/platform.sh  |   3 +-
 target/linux/ar71xx/config-4.1 |   1 +
 .../linux/ar71xx/files/arch/mips/ath79/mach-weio.c | 162 +
 target/linux/ar71xx/generic/profiles/weio.mk   |  17 +++
 target/linux/ar71xx/image/Makefile |   8 +
 .../700-MIPS-ath79-openwrt-machines.patch  |  21 ++-
 7 files changed, 209 insertions(+), 6 deletions(-)
 create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
 create mode 100644 target/linux/ar71xx/generic/profiles/weio.mk

diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh 
b/target/linux/ar71xx/base-files/lib/ar71xx.sh
index 256bd10..80af14b 100755
--- a/target/linux/ar71xx/base-files/lib/ar71xx.sh
+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh
@@ -823,6 +823,9 @@ ar71xx_board_detect() {
*UniFi AP Pro)
name=uap-pro
;;
+   *WeIO)
+   name=weio
+   ;;   
*WHR-G301N)
name=whr-g301n
;;
diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 
b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
index 76d8c5b..57df672 100755
--- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh
@@ -250,7 +250,8 @@ platform_check_image() {
nbg460n_550n_550nh | \
unifi | \
unifi-outdoor | \
-   carambola2 )
+   carambola2 | \
+   weio )
[ $magic != 2705 ]  {
echo Invalid image type.
return 1
diff --git a/target/linux/ar71xx/config-4.1 b/target/linux/ar71xx/config-4.1
index 1e31a01..0f80804 100644
--- a/target/linux/ar71xx/config-4.1
+++ b/target/linux/ar71xx/config-4.1
@@ -137,6 +137,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y
 CONFIG_ATH79_MACH_TUBE2H=y
 CONFIG_ATH79_MACH_UBNT=y
 CONFIG_ATH79_MACH_UBNT_XM=y
+CONFIG_ATH79_MACH_WEIO=y
 CONFIG_ATH79_MACH_WHR_HP_G300N=y
 CONFIG_ATH79_MACH_WLAE_AG300N=y
 CONFIG_ATH79_MACH_WLR8100=y
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c 
b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
new file mode 100644
index 000..6142ee0
--- /dev/null
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-weio.c
@@ -0,0 +1,162 @@
+/**
+ * WEIO Web Of Things Platform
+ *
+ * Copyright (C) 2013 Drasko DRASKOVIC and Uros PETREVSKI
+ *
+ *  ##  ##    ###  
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *  ##  ##  ## ####  ## ## 
+ *   ###  ###     ###
+ *
+ *   Web Of Things Platform
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Authors : 
+ * Drasko DRASKOVIC drasko.drasko...@gmail.com
+ * Uros PETREVSKI u...@nodesign.net
+ */
+
+#include asm/mach-ath79/ath79.h
+#include asm/mach-ath79/ar71xx_regs.h
+#include common.h
+#include dev-eth.h
+#include dev-gpio-buttons.h
+#include dev-leds-gpio.h
+#include dev-m25p80.h
+#include dev-spi.h
+#include dev-usb.h
+#include dev-wmac.h
+#include machtypes.h
+#include linux/i2c-gpio.h
+#include linux/platform_device.h
+
+#define WEIO_GPIO_LED_STA  1
+#define WEIO_GPIO_LED_AP   16
+//#define WEIO_GPIO_LED_ETH0   13
+
+#define WEIO_GPIO_BTN_AP   20
+#define WEIO_GPIO_BTN_RESET23
+
+#define WEIO_KEYS_POLL_INTERVAL20  /* msecs */
+#define WEIO_KEYS_DEBOUNCE_INTERVAL(3 * WEIO_KEYS_POLL_INTERVAL)
+
+#define WEIO_MAC0_OFFSET   0x
+#define WEIO_MAC1_OFFSET   0x0006
+#define WEIO_CALDATA_OFFSET0x1000
+#define WEIO_WMAC_MAC_OFFSET   0x1002
+
+static struct gpio_led weio_leds_gpio[] __initdata = {
+   {
+   .name   = weio:green:sta,
+   .gpio   = WEIO_GPIO_LED_STA,
+   .active_low = 1,
+.default_state = LEDS_GPIO_DEFSTATE_ON,
+   }, {
+