Author: kaloz Date: 2014-11-26 09:28:22 +0100 (Wed, 26 Nov 2014) New Revision: 43382
Added: trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-r6100.c trunk/target/linux/ar71xx/patches-3.14/732-MIPS-ath79-add-R6100-support.patch Modified: trunk/target/linux/ar71xx/base-files/etc/diag.sh trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh trunk/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx trunk/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh trunk/target/linux/ar71xx/config-3.14 trunk/target/linux/ar71xx/image/Makefile trunk/target/linux/ar71xx/nand/profiles/netgear.mk Log: [ar71xx]: Netgear R6100 support Signed-off-by: Imre Kaloz <[email protected]> Modified: trunk/target/linux/ar71xx/base-files/etc/diag.sh =================================================================== --- trunk/target/linux/ar71xx/base-files/etc/diag.sh 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/etc/diag.sh 2014-11-26 08:28:22 UTC (rev 43382) @@ -263,6 +263,7 @@ wzr-hp-g300nh2) status_led="buffalo:red:diag" ;; + r6100 | \ wndap360 | \ wndr3700 | \ wndr3700v4 | \ Modified: trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom =================================================================== --- trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom 2014-11-26 08:28:22 UTC (rev 43382) @@ -38,6 +38,7 @@ case "$FIRMWARE" in "soc_wmac.eeprom") case $board in + r6100 | \ wndr3700v4 | \ wndr4300) ath9k_eeprom_extract "caldata" 4096 2048 Modified: trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds =================================================================== --- trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds 2014-11-26 08:28:22 UTC (rev 43382) @@ -421,6 +421,12 @@ ucidef_set_led_usbdev "usb" "USB" "netgear:green:usb" "1-1" ;; +r6100) + ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0.2" + ucidef_set_led_usbdev "usb" "USB" "netgear:blue:usb" "1-1" + ucidef_set_led_wlan "wlan" "WLAN" "netgear:blue:wlan" "phy1tpt" + ;; + wndr3700v4 | \ wndr4300) ucidef_set_led_netdev "wan" "WAN (green)" "netgear:green:wan" "eth0.2" Modified: trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network =================================================================== --- trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/etc/uci-defaults/02_network 2014-11-26 08:28:22 UTC (rev 43382) @@ -201,7 +201,8 @@ ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; -smart-300 | \ +r6100 |\ +smart-300 |\ tl-mr3420-v2 |\ tl-wr841n-v8 |\ tl-wr842n-v2 |\ Modified: trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh =================================================================== --- trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/lib/ar71xx.sh 2014-11-26 08:28:22 UTC (rev 43382) @@ -701,6 +701,9 @@ *"WNDR3700/WNDR3800/WNDRMAC") wndr3700_board_detect "$machine" ;; + *"R6100") + name="r6100" + ;; *"WNDR3700v4") name="wndr3700v4" ;; Modified: trunk/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx =================================================================== --- trunk/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx 2014-11-26 08:28:22 UTC (rev 43382) @@ -29,6 +29,12 @@ fetch_mac_from_mtd config lan_mac wan_mac echo 1 > /sys/class/leds/dir-615-c1:green:wancpu/brightness ;; + r6100) + mac_lan=$(mtd_get_mac_binary caldata 0) + [ -n "$mac_lan" ] && ifconfig eth1 hw ether "$mac_lan" + mac_wan=$(mtd_get_mac_binary caldata 6) + [ -n "$mac_wan" ] && ifconfig eth0 hw ether "$mac_wan" + ;; wrt160nl) fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr ;; Modified: trunk/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin =================================================================== --- trunk/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/lib/preinit/81_load_ath10k_board_bin 2014-11-26 08:28:22 UTC (rev 43382) @@ -22,7 +22,17 @@ macaddr_2bin $mac >> /tmp/ath10k-board.bin dd if=/dev/mtdblock4 \ bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin + ;; + r6100) + local mac + mac=$(macaddr_add $(cat /sys/class/net/eth1/address) +2) + dd if=/dev/mtdblock2 \ + bs=1 skip=20480 count=6 \ + of=/tmp/ath10k-board.bin + macaddr_2bin $mac >> /tmp/ath10k-board.bin + dd if=/dev/mtdblock2 \ + bs=1 skip=20492 count=2104 >> /tmp/ath10k-board.bin ;; qihoo-c301) local mac Modified: trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh =================================================================== --- trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/base-files/lib/upgrade/platform.sh 2014-11-26 08:28:22 UTC (rev 43382) @@ -354,6 +354,7 @@ return 0 ;; nbg6716 | \ + r6100 | \ wndr3700v4 | \ wndr4300 ) nand_do_platform_check $board $1 Modified: trunk/target/linux/ar71xx/config-3.14 =================================================================== --- trunk/target/linux/ar71xx/config-3.14 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/config-3.14 2014-11-26 08:28:22 UTC (rev 43382) @@ -76,6 +76,7 @@ CONFIG_ATH79_MACH_PB44=y CONFIG_ATH79_MACH_PB92=y CONFIG_ATH79_MACH_QIHOO_C301=y +CONFIG_ATH79_MACH_R6100=y # CONFIG_ATH79_MACH_RB2011 is not set # CONFIG_ATH79_MACH_RB4XX is not set # CONFIG_ATH79_MACH_RB750 is not set Added: trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-r6100.c =================================================================== --- trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-r6100.c (rev 0) +++ trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-r6100.c 2014-11-26 08:28:22 UTC (rev 43382) @@ -0,0 +1,146 @@ +/* + * NETGEAR R6100 board support + * + * Copyright (C) 2014 Gabor Juhos <[email protected]> + * Copyright (C) 2014 Imre Kaloz <[email protected]> + * + * 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/pci.h> +#include <linux/phy.h> +#include <linux/gpio.h> +#include <linux/platform_device.h> +#include <linux/ath9k_platform.h> +#include <linux/platform/ar934x_nfc.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-nfc.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define R6100_GPIO_LED_WLAN 0 +#define R6100_GPIO_LED_USB 11 +#define R6100_GPIO_LED_WAN_GREEN 13 +#define R6100_GPIO_LED_POWER_AMBER 14 +#define R6100_GPIO_LED_WAN_AMBER 15 +#define R6100_GPIO_LED_POWER_GREEN 17 + +#define R6100_GPIO_BTN_WIRELESS 1 +#define R6100_GPIO_BTN_WPS 3 +#define R6100_GPIO_BTN_RESET 12 + +#define R6100_GPIO_USB_POWER 16 + +#define R6100_KEYS_POLL_INTERVAL 20 /* msecs */ +#define R6100_KEYS_DEBOUNCE_INTERVAL (3 * R6100_KEYS_POLL_INTERVAL) + +static struct gpio_led r6100_leds_gpio[] __initdata = { + { + .name = "netgear:green:power", + .gpio = R6100_GPIO_LED_POWER_GREEN, + .active_low = 1, + }, + { + .name = "netgear:amber:power", + .gpio = R6100_GPIO_LED_POWER_AMBER, + .active_low = 1, + }, + { + .name = "netgear:green:wan", + .gpio = R6100_GPIO_LED_WAN_GREEN, + .active_low = 1, + }, + { + .name = "netgear:amber:wan", + .gpio = R6100_GPIO_LED_WAN_AMBER, + .active_low = 1, + }, + { + .name = "netgear:blue:usb", + .gpio = R6100_GPIO_LED_USB, + .active_low = 1, + }, + { + .name = "netgear:blue:wlan", + .gpio = R6100_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button r6100_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = R6100_KEYS_DEBOUNCE_INTERVAL, + .gpio = R6100_GPIO_BTN_RESET, + .active_low = 0, + }, + { + .desc = "WPS button", + .type = EV_KEY, + .code = KEY_WPS_BUTTON, + .debounce_interval = R6100_KEYS_DEBOUNCE_INTERVAL, + .gpio = R6100_GPIO_BTN_WPS, + .active_low = 0, + }, + { + .desc = "RFKILL switch", + .type = EV_SW, + .code = KEY_RFKILL, + .debounce_interval = R6100_KEYS_DEBOUNCE_INTERVAL, + .gpio = R6100_GPIO_BTN_WIRELESS, + .active_low = 0, + }, +}; + +static void __init r6100_setup(void) +{ + ath79_register_leds_gpio(-1, ARRAY_SIZE(r6100_leds_gpio), + r6100_leds_gpio); + ath79_register_gpio_keys_polled(-1, R6100_KEYS_POLL_INTERVAL, + ARRAY_SIZE(r6100_gpio_keys), + r6100_gpio_keys); + + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP); + + ath79_register_mdio(1, 0x0); + + /* GMAC0 is connected to the PHY0 of the internal switch */ + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = BIT(0); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_register_eth(0); + + /* GMAC1 is connected to the internal switch */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_register_eth(1); + + gpio_request_one(R6100_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); + + ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW); + ath79_register_nfc(); + + ath79_register_usb(); + + ath79_register_wmac_simple(); + + ap91_pci_init_simple(); +} + +MIPS_MACHINE(ATH79_MACH_R6100, "R6100", "NETGEAR R6100", + r6100_setup); Modified: trunk/target/linux/ar71xx/image/Makefile =================================================================== --- trunk/target/linux/ar71xx/image/Makefile 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/image/Makefile 2014-11-26 08:28:22 UTC (rev 43382) @@ -301,6 +301,7 @@ wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro wndr3700_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,7680k(firmware),64k(art)ro wndr3700v2_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro +r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata),256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter) wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata),512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved) zcn1523h_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6208k(rootfs),1472k(kernel),64k(configure)ro,64k(mfg)ro,64k(art)ro,7680k@0x50000(firmware) mynet_n600_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro @@ -1343,6 +1344,7 @@ ifeq ($(SUBTARGET),nand) $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300)) $(eval $(call SingleProfile,NetgearNAND,64k,WNDR4300V1,wndr4300,WNDR4300,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR4300,"",-H 29763948+0+128+128+2x2+3x3,wndr4300)) +$(eval $(call SingleProfile,NetgearNAND,64k,R6100,r6100,R6100,ttyS0,115200,$$(r6100_mtdlayout),0x36303030,R6100,"",-H 29764434+0+128+128+2x2+2x2,wndr4300)) $(eval $(call SingleProfile,ZyXELNAND,128k,NBG6716,nbg6716,NBG6716,ttyS0,115200,NBG6716,$$(zyx_nbg6716_mtdlayout),mem=256M)) Modified: trunk/target/linux/ar71xx/nand/profiles/netgear.mk =================================================================== --- trunk/target/linux/ar71xx/nand/profiles/netgear.mk 2014-11-25 20:34:08 UTC (rev 43381) +++ trunk/target/linux/ar71xx/nand/profiles/netgear.mk 2014-11-26 08:28:22 UTC (rev 43382) @@ -1,10 +1,22 @@ # -# Copyright (C) 2009-2013 OpenWrt.org +# Copyright (C) 2009-2014 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # +define Profile/R6100 + NAME:=NETGEAR R6100 + PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev +endef + +define Profile/R6100/Description + Package set optimized for the NETGEAR R6100 +endef + +$(eval $(call Profile,R6100)) + + define Profile/WNDR4300 NAME:=NETGEAR WNDR3700v4/WNDR4300 PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-ledtrig-usbdev @@ -15,5 +27,3 @@ endef $(eval $(call Profile,WNDR4300)) - - Added: trunk/target/linux/ar71xx/patches-3.14/732-MIPS-ath79-add-R6100-support.patch =================================================================== --- trunk/target/linux/ar71xx/patches-3.14/732-MIPS-ath79-add-R6100-support.patch (rev 0) +++ trunk/target/linux/ar71xx/patches-3.14/732-MIPS-ath79-add-R6100-support.patch 2014-11-26 08:28:22 UTC (rev 43382) @@ -0,0 +1,40 @@ +--- a/arch/mips/ath79/Kconfig ++++ b/arch/mips/ath79/Kconfig +@@ -483,6 +483,17 @@ config ATH79_MACH_WRT400N + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + ++config ATH79_MACH_R6100 ++ bool "NETGEAR R6100 board support" ++ select SOC_AR934X ++ select ATH79_DEV_AP9X_PCI if PCI ++ select ATH79_DEV_ETH ++ select ATH79_DEV_GPIO_BUTTONS ++ select ATH79_DEV_LEDS_GPIO ++ select ATH79_DEV_NFC ++ select ATH79_DEV_USB ++ select ATH79_DEV_WMAC ++ + config ATH79_MACH_RB4XX + bool "MikroTik RouterBOARD 4xx series support" + select SOC_AR71XX +--- a/arch/mips/ath79/Makefile ++++ b/arch/mips/ath79/Makefile +@@ -88,6 +88,7 @@ obj-$(CONFIG_ATH79_MACH_PB42) += mach-p + obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o + obj-$(CONFIG_ATH79_MACH_PB92) += mach-pb92.o + obj-$(CONFIG_ATH79_MACH_QIHOO_C301) += mach-qihoo-c301.o ++obj-$(CONFIG_ATH79_MACH_R6100) += mach-r6100.o + obj-$(CONFIG_ATH79_MACH_RB4XX) += mach-rb4xx.o + obj-$(CONFIG_ATH79_MACH_RB750) += mach-rb750.o + obj-$(CONFIG_ATH79_MACH_RB91X) += mach-rb91x.o +--- a/arch/mips/ath79/machtypes.h ++++ b/arch/mips/ath79/machtypes.h +@@ -84,6 +84,7 @@ enum ath79_mach_type { + ATH79_MACH_PB42, /* Atheros PB42 */ + ATH79_MACH_PB92, /* Atheros PB92 */ + ATH79_MACH_QIHOO_C301, /* Qihoo 360 C301 */ ++ ATH79_MACH_R6100, /* NETGEAR R6100 */ + ATH79_MACH_RB_411, /* MikroTik RouterBOARD 411/411A/411AH */ + ATH79_MACH_RB_411U, /* MikroTik RouterBOARD 411U */ + ATH79_MACH_RB_433, /* MikroTik RouterBOARD 433/433AH */ _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
