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

John Crispin john at phrozen.org
Sat Jan 13 05:11:31 PST 2018


Hi,

patch is whitespace mangled and does not apply. How did you send the patch ?


[...]

> --- 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
here

> +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
and here

     John

> +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/ar71xx/files/arch/mips/ath79/Makefile
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile
> @@ -115,6 +115,7 @@ obj-$(CONFIG_ATH79_MACH_ENS202EXT)		+= mach-ens202ext.o
>   obj-$(CONFIG_ATH79_MACH_EPG5000)		+= mach-epg5000.o
>   obj-$(CONFIG_ATH79_MACH_ESR1750)		+= mach-esr1750.o
>   obj-$(CONFIG_ATH79_MACH_ESR900)			+= mach-esr900.o
> +obj-$(CONFIG_ATH79_MACH_EW_BALIN)		+= mach-ew-balin.o
>   obj-$(CONFIG_ATH79_MACH_EW_DORIN)		+= mach-ew-dorin.o
>   obj-$(CONFIG_ATH79_MACH_F9K1115V2)		+= mach-f9k1115v2.o
>   obj-$(CONFIG_ATH79_MACH_FRITZ300E)		+= mach-fritz300e.o
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> new file mode 100644
> index 0000000000..7d7f38c1d2
> --- /dev/null
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ew-balin.c
> @@ -0,0 +1,112 @@
> +/*
> + * EW Balin board support
> + * (based on Atheros DB120 reference board support)
> + *
> + * Copyright (c) 2011 Qualcomm Atheros
> + * Copyright (c) 2011-2012 Gabor Juhos <juhosg at openwrt.org>
> + * Copyright (C) 2017 Embedded Wireless GmbH    www.80211.de
> + *
> + * Permission to use, copy, modify, and/or distribute this software for
> +any
> + * purpose with or without fee is hereby granted, provided that the
> +above
> + * copyright notice and this permission notice appear in all copies.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
> +WARRANTIES
> + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
> + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
> +FOR
> + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
> +DAMAGES
> + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
> +AN
> + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
> +OF
> + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> + *
> + */
> +
> +#include <linux/pci.h>
> +#include <linux/phy.h>
> +#include <linux/platform_device.h>
> +#include <linux/ath9k_platform.h>
> +#include <linux/ar8216_platform.h>
> +
> +#include <asm/mach-ath79/ar71xx_regs.h>
> +
> +#include "common.h"
> +#include "dev-ap9x-pci.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 "pci.h"
> +
> +#define BALIN_GPIO_LED_STATUS	14
> +
> +#define BALIN_GPIO_BTN_WPS		18
> +
> +#define BALIN_KEYS_POLL_INTERVAL	20	/* msecs */
> +#define BALIN_KEYS_DEBOUNCE_INTERVAL	(3 * BALIN_KEYS_POLL_INTERVAL)
> +
> +#define BALIN_CALDATA_OFFSET		0x1000
> +#define BALIN_WMAC_MAC_OFFSET		(BALIN_CALDATA_OFFSET + 0x02)
> +
> +static struct gpio_led balin_leds_gpio[] __initdata = {
> +	{
> +		.name		= "balin:green:status",
> +		.gpio		= BALIN_GPIO_LED_STATUS,
> +		.active_low	= 1,
> +	},
> +};
> +
> +static struct gpio_keys_button balin_gpio_keys[] __initdata = {
> +	{
> +		.desc		= "WPS button",
> +		.type		= EV_KEY,
> +		.code		= KEY_WPS_BUTTON,
> +		.debounce_interval = BALIN_KEYS_DEBOUNCE_INTERVAL,
> +		.gpio		= BALIN_GPIO_BTN_WPS,
> +		.active_low	= 0,
> +	},
> +};
> +
> +
> +static void __init balin_setup(void)
> +{
> +	u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
> +	static u8 mac[6];
> +
> +	ath79_register_m25p80(NULL);
> +
> +	ath79_register_leds_gpio(-1, ARRAY_SIZE(balin_leds_gpio),
> +				 balin_leds_gpio);
> +
> +	ath79_register_gpio_keys_polled(-1, BALIN_KEYS_POLL_INTERVAL,
> +					ARRAY_SIZE(balin_gpio_keys),
> +					balin_gpio_keys);
> +
> +	ath79_register_usb();
> +
> +
> +	ath79_register_wmac(art + BALIN_CALDATA_OFFSET,
> +				    art + BALIN_WMAC_MAC_OFFSET);
> +
> +	ath79_register_pci();
> +
> +	ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 |
> +				   AR934X_ETH_CFG_SW_ONLY_MODE);
> +
> +	ath79_register_mdio(1, 0x0);
> +
> +	/* GMAC1 is connected to the internal switch */
> +	memcpy(mac, art + BALIN_WMAC_MAC_OFFSET, sizeof(mac));
> +	mac[3] |= 0x40;
> +	ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0);
> +	ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII;
> +	ath79_eth1_data.speed = SPEED_1000;
> +	ath79_eth1_data.duplex = DUPLEX_FULL;
> +
> +	ath79_register_eth(1);
> +}
> +
> +MIPS_MACHINE(ATH79_MACH_EW_BALIN, "EW-BALIN", "EmbWir-Balin",
> +	     balin_setup);
> diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> index 0f536f0ec5..ca684b4209 100644
> --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h
> @@ -106,6 +106,7 @@ enum ath79_mach_type {
>   	ATH79_MACH_EPG5000,			/* EnGenius EPG5000 */
>   	ATH79_MACH_ESR1750,			/* EnGenius ESR1750 */
>   	ATH79_MACH_ESR900,			/* EnGenius ESR900 */
> +	ATH79_MACH_EW_BALIN,			/* embedded wireless Balin Platform */
>   	ATH79_MACH_EW_DORIN,			/* embedded wireless Dorin Platform */
>   	ATH79_MACH_EW_DORIN_ROUTER,		/* embedded wireless Dorin Router Platform */
>   	ATH79_MACH_F9K1115V2,			/* Belkin AC1750DB */
> diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk
> index 6829f113a7..9e9f747803 100644
> --- a/target/linux/ar71xx/image/generic.mk
> +++ b/target/linux/ar71xx/image/generic.mk
> @@ -229,6 +229,15 @@ define Device/dragino2  endef  TARGET_DEVICES += dragino2
>   
> +define Device/ew-balin
> +  DEVICE_TITLE := Embedded Wireless Balin Platform
> +  DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea
> +  BOARDNAME = EW-BALIN
> +  IMAGE_SIZE = 16000k
> +  MTDPARTS =
> +spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(firmware),64k(art)ro
> +endef
> +TARGET_DEVICES += ew-balin
> +
>   define Device/ew-dorin
>     DEVICE_TITLE := Embedded Wireless Dorin Platform
>     DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default
> index a77813d23d..ffa07bd3dd 100644
> --- a/target/linux/ar71xx/mikrotik/config-default
> +++ b/target/linux/ar71xx/mikrotik/config-default
> @@ -73,6 +73,7 @@
>   # CONFIG_ATH79_MACH_EPG5000 is not set
>   # CONFIG_ATH79_MACH_ESR1750 is not set
>   # CONFIG_ATH79_MACH_ESR900 is not set
> +# CONFIG_ATH79_MACH_EW_BALIN is not set
>   # CONFIG_ATH79_MACH_EW_DORIN is not set  # CONFIG_ATH79_MACH_F9K1115V2 is not set  # CONFIG_ATH79_MACH_FRITZ300E is not set diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default
> index d85a21d91a..18d56c1f80 100644
> --- a/target/linux/ar71xx/nand/config-default
> +++ b/target/linux/ar71xx/nand/config-default
> @@ -74,6 +74,7 @@ CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
>   # CONFIG_ATH79_MACH_EPG5000 is not set
>   # CONFIG_ATH79_MACH_ESR1750 is not set
>   # CONFIG_ATH79_MACH_ESR900 is not set
> +# CONFIG_ATH79_MACH_EW_BALIN is not set
>   # CONFIG_ATH79_MACH_EW_DORIN is not set  # CONFIG_ATH79_MACH_F9K1115V2 is not set  # CONFIG_ATH79_MACH_FRITZ300E is not set
> --
> 2.14.3 (Apple Git-98)
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev




More information about the Lede-dev mailing list