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

Drasko DRASKOVIC drasko.draskovic at gmail.com
Sat Jul 25 14:23:10 EDT 2015


Hi Karl,

On Thu, Jun 18, 2015 at 2:35 AM, Karl Palsson <karlp at tweak.net.au> wrote:
>
> You said you're removed the commented out code?
>
> Also, somehow your description ended up in the subject...
>
> (More comments inline, but this looks like an older version of the patch)
>
>
> Sincerely,
> Karl Palsson
>
>
> Drasko DRASKOVIC <drasko.draskovic at gmail.com> wrote:
>> Signed-off-by: Drasko DRASKOVIC <drasko.draskovic at gmail.com>
>> ---
>>  target/linux/ar71xx/base-files/lib/ar71xx.sh       |   3 +
>>  .../ar71xx/base-files/lib/upgrade/platform.sh      |   3 +-
>>  target/linux/ar71xx/config-3.18                    |   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 +
>>  .../610-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
>>
>
>> +
>> +#define WEIO_GPIO_LED_STA            1
>> +#define WEIO_GPIO_LED_AP             16
>> +//#define WEIO_GPIO_LED_ETH0 13
>
> Is there or not? Kill it if it doesn't exist.
>
>> +
>> +#define WEIO_GPIO_BTN_AP         20
>> +#define WEIO_GPIO_BTN_RESET          23
>> +
>> +#define WEIO_KEYS_POLL_INTERVAL              20      /* msecs */
>> +#define WEIO_KEYS_DEBOUNCE_INTERVAL  (3 * WEIO_KEYS_POLL_INTERVAL)
>> +
>> +#define WEIO_MAC0_OFFSET                     0x0000
>> +#define WEIO_MAC1_OFFSET                     0x0006
>> +#define WEIO_CALDATA_OFFSET              0x1000
>
>
>> +static void __init weio_common_setup(void)
>> +{
>> +     u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
>> +
>> +     ath79_register_m25p80(NULL);
>> +     ath79_register_wmac(art + WEIO_CALDATA_OFFSET,
>> +                         art + WEIO_WMAC_MAC_OFFSET);
>> +
>> +    /** WeIO does not use ETH - only WiFi by default */
>> +#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 */
>> +}
>> +
>
> This was already raised earlier?
>
>> +static void __init weio_setup(void)
>> +{
>> +     weio_common_setup();
>> +
>> +
>> +     ath79_gpio_function_disable(AR933X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
>> +                             AR933X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
>> +                             AR933X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
>> +                             AR933X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
>> +                AR933X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
>> +
>> +    platform_add_devices(weio_devices, ARRAY_SIZE(weio_devices));
>> +
>> +     ath79_register_leds_gpio(-1, ARRAY_SIZE(weio_leds_gpio),
>> +                              weio_leds_gpio);
>> +
>> +     ath79_register_gpio_keys_polled(-1, WEIO_KEYS_POLL_INTERVAL,
>> +                                     ARRAY_SIZE(weio_gpio_keys),
>> +                                     weio_gpio_keys);
>> +     ath79_register_usb();
>> +}
>> +
>> +MIPS_MACHINE(ATH79_MACH_WEIO, "WEIO", "WeIO board from Drasko DRASKOVIC and Uros PETREVSKI",
>
> Really?  That's your model name?  Really?  Are you _sure_ that's what
> you want?

Yes, the name of the board is WeIO.

>
>
>> +             weio_setup);
>> diff --git a/target/linux/ar71xx/generic/profiles/weio.mk
>> b/target/linux/ar71xx/generic/profiles/weio.mk
>> new file mode 100644
>> index 0000000..227cec9
>> --- /dev/null
>> +++ b/target/linux/ar71xx/generic/profiles/weio.mk
>> @@ -0,0 +1,17 @@
>> +#
>> +# Copyright (C) 2013 OpenWrt.org
>> +#
>> +# This is free software, licensed under the GNU General Public License v2.
>> +# See /LICENSE for more information.
>> +#
>> +
>> +define Profile/WEIO
>> +        NAME:=WeIO
>> +        PACKAGES:=kmod-usb-core kmod-usb2
>> +endef
>> +
>> +define Profile/WEIO/Description
>> +        Package set optimized for the WeIO board.
>> +endef
>> +
>> +$(eval $(call Profile,WEIO))
>> diff --git a/target/linux/ar71xx/image/Makefile
>> b/target/linux/ar71xx/image/Makefile
>> index 21d0d66..1f08ca0 100644
>> --- a/target/linux/ar71xx/image/Makefile
>> +++ b/target/linux/ar71xx/image/Makefile
>> @@ -179,6 +179,14 @@ define Device/carambola2
>>  endef
>>  TARGET_DEVICES += carambola2
>>
>> +define Device/weio
>> +  BOARDNAME = WEIO
>> +  IMAGE_SIZE = 16000k
>> +  CONSOLE = ttyATH0,115200
>> +  MTDPARTS = spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,16000k(firmware),64k(art)ro
>> +endef
>> +TARGET_DEVICES += weio
>> +
>>  define Device/wndr3700
>>    BOARDNAME = WNDR3700
>>    NETGEAR_KERNEL_MAGIC = 0x33373030
>> diff --git
>> a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
>> b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
>> index f8a561c..e8c8d5a 100644
>> --- a/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
>> +++ b/target/linux/ar71xx/patches-3.18/610-MIPS-ath79-openwrt-machines.patch
>> @@ -1,6 +1,6 @@
>>  --- a/arch/mips/ath79/machtypes.h
>>  +++ b/arch/mips/ath79/machtypes.h
>> -@@ -16,22 +16,191 @@
>> +@@ -16,22 +16,192 @@
>>
>>   enum ath79_mach_type {
>>       ATH79_MACH_GENERIC = 0,
>> @@ -25,6 +25,7 @@
>>  +    ATH79_MACH_BHU_BXU2000N2_A1,    /* BHU BXU2000n-2 A1 */
>>  +    ATH79_MACH_CAP4200AG,           /* Senao CAP4200AG */
>>  +    ATH79_MACH_CARAMBOLA2,          /* 8devices Carambola2 */
>> ++    ATH79_MACH_WEIO,                /* WeIO board */
>
>
> Cmon man, are you sure you attached the right patch here?

Yes, why? I can see nothing wrong with this patch.

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



More information about the openwrt-devel mailing list