[OpenWrt-Devel] [PATCH] ar71xx: add support for WNXT01/Springmole Boards
Karl Palsson
karlp at tweak.net.au
Wed Oct 15 07:11:05 EDT 2014
On Wed, Oct 15, 2014 at 10:03:31AM +0200, Massimiliano Galanti wrote:
> WNXT01/Springmole is a family of OEM boards designed by Wi-Next. This
> patch adds the core files needed by openwrt to support them. See:
> http://www.winext.eu http://www.springmole.com
>
> Signed-off-by: Massimiliano Galanti <massimiliano.galanti at winext.eu>
>
> ---
>
> diff -Nur a/linux/ar71xx/patches-3.10/999-springmole-boards.patch
> b/linux/ar71xx/patches-3.10/999-springmole-boards.patch
> --- a/linux/ar71xx/patches-3.10/999-springmole-boards.patch 1970-01-01
> 01:00:00.000000000 +0100
> +++ b/linux/ar71xx/patches-3.10/999-springmole-boards.patch 2014-10-15
> 09:17:28.901559041 +0200
> @@ -0,0 +1,36 @@
> +--- a/arch/mips/ath79/Makefile 2013-09-26 15:29:58.425003764 +0200
> ++++ b/arch/mips/ath79/Makefile 2013-09-26 14:45:45.788877459 +0200
> +@@ -119,3 +119,4 @@
> + obj-$(CONFIG_ATH79_MACH_WZR_HP_G450H) += mach-wzr-hp-g450h.o
> + obj-$(CONFIG_ATH79_MACH_ZCN_1523H) += mach-zcn-1523h.o
> + obj-$(CONFIG_ATH79_MACH_CARAMBOLA2) += mach-carambola2.o
> ++obj-$(CONFIG_ATH79_MACH_WNXT01) += mach-wnxt01.o mach-wnxt01lc.o
I realize that the carambola2 is at the end of the list, but I think it would be preferred if
these entries were kept in alphabetical order.
> +--- a/arch/mips/ath79/Kconfig 2013-09-26 15:29:58.421003763 +0200
> ++++ b/arch/mips/ath79/Kconfig 2013-09-26 14:44:17.832873176 +0200
> +@@ -806,6 +806,15 @@
> + select ATH79_DEV_USB
> + select ATH79_DEV_WMAC
> +
> ++config ATH79_MACH_WNXT01
> ++ bool "Springmole Boards"
> ++ select SOC_AR724X
> ++ select ATH79_DEV_ETH
> ++ select ATH79_DEV_GPIO_BUTTONS
> ++ select ATH79_DEV_LEDS_GPIO
> ++ select ATH79_DEV_PB9X_PCI if PCI
> ++ select ATH79_DEV_USB
> ++
> + endmenu
> +
> + config SOC_AR71XX
> +--- a/arch/mips/ath79/machtypes.h 2013-09-26 15:29:58.433003766 +0200
> ++++ b/arch/mips/ath79/machtypes.h 2013-09-26 14:45:06.356875493 +0200
> +@@ -144,6 +144,8 @@
> + ATH79_MACH_WZR_HP_G450H, /* Buffalo WZR-HP-G450H */
> + ATH79_MACH_ZCN_1523H_2, /* Zcomax ZCN-1523H-2-xx */
> + ATH79_MACH_ZCN_1523H_5, /* Zcomax ZCN-1523H-5-xx */
> ++ ATH79_MACH_WNXT01,
> ++ ATH79_MACH_WNXT01LC,
Alphabetical here too
> + };
> +
> + #endif /* _ATH79_MACHTYPE_H */
> diff -Nur a/target/linux/ar71xx/base-files/lib/ar71xx.sh
> b/target/linux/ar71xx/base-files/lib/ar71xx.sh
> --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh 2014-10-15
> 09:24:44.217579800 +0200
> +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh 2014-10-15
> 09:17:28.937559047 +0200
> @@ -737,6 +737,12 @@
> *ZCN-1523H-5)
> name="zcn-1523h-5"
> ;;
> + *"Wi-Next 01 Board")
> + name="wnxt01"
> + ;;
> + *"Wi-Next 01 LC Board")
> + name="wnxt01lc"
> + ;;
Again, there's a few boards (EmbWir Dorin, carambola2, and a few more at the end) that were
appeneded at the end, but most of them are in alphabetical order. I believe it's normally
requested to keep them in alphabetical order.
> *EmbWir-Dorin)
> name="ew-dorin"
> ;;
> diff -Nur a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnxt01.c
> b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnxt01.c
> --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wnxt01.c
> 1970-01-01 01:00:00.000000000 +0100
> +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wnxt01.c
> 2014-10-15 09:17:28.901559041 +0200
> @@ -0,0 +1,304 @@
> +/*
> + * Wi-Next WNXT01 board support
> + *
> + * Copyright (C) 2014 Wi-Next <info at winext.eu>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of the GNU General Public License version 2 as published
> + * by the Free Software Foundation.
> + */
> +
> +#include <linux/mtd/mtd.h>
> +#include <linux/mtd/partitions.h>
> +
> +#include <linux/i2c.h>
> +#include <linux/i2c-algo-bit.h>
> +#include <linux/i2c-gpio.h>
> +
> +#include <linux/spi/mcp23s08.h>
> +#include <linux/i2c/ads1015.h>
> +//#include <linux/rtc/ds1307.h>
> +
> +#include <linux/spi/spi.h>
> +#include <linux/spi/flash.h>
> +#include <linux/spi/mmc_spi.h>
> +#include <linux/mmc/host.h>
> +#include <linux/platform_device.h>
> +#include <linux/ar8216_platform.h>
> +
> +#include <asm/mach-ath79/ath79.h>
> +
> +#include <asm/gpio.h>
> +
> +#include "dev-eth.h"
> +#include "dev-gpio-buttons.h"
> +#include "dev-leds-gpio.h"
> +#include "dev-spi.h"
> +#include "dev-usb.h"
> +#include "machtypes.h"
> +#include "pci.h"
> +
> +#define WNXT01_GPIO_I2C_SDA 12
> +#define WNXT01_GPIO_I2C_SCL 14
> +
> +static struct i2c_gpio_platform_data i2c_device_platdata = {
> + .sda_pin = WNXT01_GPIO_I2C_SDA,
> + .scl_pin = WNXT01_GPIO_I2C_SCL,
> + .scl_is_output_only = 1,
> +};
> +
> +static struct platform_device i2c_gpio_device = {
> + .name = "i2c-gpio",
> + .id = 0,
> + .dev = {
> + .platform_data = &i2c_device_platdata,
> + },
> +};
> +
> +static struct mcp23s08_platform_data mcp23s08_platdata = {
> + .chip = {
> + {
> + .is_present = 1,
> + .pullups = (1 << 4 | 1 << 5),
> + },
> + },
> + .base = 20,
> +};
> +
> +#define WNXT01_GPIO_EXP0 20
> +#define WNXT01_GPIO_EXP1 21
> +#define WNXT01_GPIO_EXP2 22
> +#define WNXT01_GPIO_EXP3 23
> +
> +#define WNXT01_GPIO_BTN0 24
> +#define WNXT01_GPIO_BTN1 25
> +#define WNXT01_GPIO_SDEN 26
> +#define WNXT01_GPIO_USEN 27
> +
> +static struct ads1015_platform_data ads1015_platdata = {
> + .channel_data = {
> + [4] = { .enabled = true, .pga = 1, .data_rate = 0 },
> + [5] = { .enabled = true, .pga = 1, .data_rate = 0 },
> + [6] = { .enabled = true, .pga = 1, .data_rate = 0 },
> + [7] = { .enabled = true, .pga = 1, .data_rate = 0 },
> + }
> +};
> +
> +//static struct ds1307_platform_data ds1307_platform_data = {
> +// .trickle_charger_setup = 0,
> +//};
What is this meant to be here fore?
> +
> +static struct i2c_board_info i2c_devs[] __initdata = {
> + {
> + I2C_BOARD_INFO("mcp23008", 0x20),
> + .platform_data = &mcp23s08_platdata,
> + },
> + {
> + I2C_BOARD_INFO("ads1015", 0x48),
> + .platform_data = &ads1015_platdata,
> + },
> + {
> + I2C_BOARD_INFO("ds1339", 0x68),
> + //.platform_data = &ds1307_platform_data,
> + },
> +};
> +
> +static struct ath79_spi_controller_data ath79_spi0_cdata =
> +{
> + .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
> + .cs_line = 0,
> +};
> +
> +static struct ath79_spi_controller_data ath79_spi1_cdata =
> +{
> + .cs_type = ATH79_SPI_CS_TYPE_INTERNAL,
> + .cs_line = 1,
> +};
> +
> +static struct flash_platform_data pb92_flash_data = {
> + .name = "ar7240-nor0",
> +};
> +
> +#include <linux/delay.h>
> +static int wnxt01_mmc_init(struct device *dev, irqreturn_t
> (*isr)(int, void *), void *data)
> +{
> + gpio_request(WNXT01_GPIO_SDEN, "SD power");
> + //gpio_direction_output(WNXT01_GPIO_SDEN, 0);
> +
> + //mdelay(500);
> + gpio_direction_output(WNXT01_GPIO_SDEN, 1);
> + mdelay(500);
> +
> + return 0;
> +}
This looks.... suspicious style wise.
I haven't read any further, as already mentioned, the whitespace needs fixing too.
Cheers,
Karl P
_______________________________________________
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