mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 03:43:29 +00:00
ar71xx: add support for sbr-ac1750 board from Mleaf
This commit is contained in:
parent
f36dc71bf0
commit
4c8a7bbb35
@ -287,6 +287,12 @@ dw33d)
|
||||
ucidef_set_led_netdev "internet" "INTERNET" "$board:blue:internet" "eth0"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN-2.4G" "$board:blue:wlan-2g" "phy1tpt"
|
||||
;;
|
||||
sbr-ac1750)
|
||||
ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1"
|
||||
ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN-2.4G" "$board:blue:wlan-2g" "phy1tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN-5G" "$board:blue:wlan-5g" "phy0tpt"
|
||||
;;
|
||||
eap300v2)
|
||||
ucidef_set_led_netdev "lan" "LAN" "engenius:blue:lan" "eth0"
|
||||
ucidef_set_led_wlan "wlan" "WLAN" "engenius:blue:wlan" "phy0tpt"
|
||||
|
@ -440,6 +440,11 @@ ar71xx_setup_interfaces()
|
||||
ucidef_add_switch "switch0" \
|
||||
"2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "0@eth0" "1:wan"
|
||||
;;
|
||||
sbr-ac1750)
|
||||
ucidef_set_interfaces_lan_wan "eth1.1" "eth0.2"
|
||||
ucidef_add_switch "switch0" \
|
||||
"1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "0@eth0" "5:wan"
|
||||
;;
|
||||
gl-ar300|\
|
||||
wnr2000-v3)
|
||||
ucidef_set_interfaces_lan_wan "eth1.1" "eth0"
|
||||
|
@ -210,6 +210,7 @@ get_status_led() {
|
||||
status_led="$board:red:system"
|
||||
;;
|
||||
dw33d|\
|
||||
sbr-ac1750|\
|
||||
r36a)
|
||||
status_led="$board:blue:status"
|
||||
;;
|
||||
|
@ -83,6 +83,10 @@ case "$FIRMWARE" in
|
||||
ath9k_eeprom_extract "art" 4096 2048
|
||||
ath9k_patch_firmware_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +3)
|
||||
;;
|
||||
sbr-ac1750)
|
||||
ath9k_eeprom_extract "art" 4096 2048
|
||||
ath9k_patch_firmware_mac$(mtd_get_mac_binary art 0)
|
||||
;;
|
||||
mr18)
|
||||
. /lib/upgrade/nand.sh
|
||||
|
||||
|
@ -134,6 +134,10 @@ case "$FIRMWARE" in
|
||||
ath10kcal_extract "art" 20480 2116
|
||||
ath10kcal_patch_mac $(mtd_get_mac_binary art 18)
|
||||
;;
|
||||
sbr-ac1750)
|
||||
ath10kcal_extract "art" 20480 2116
|
||||
ath10kcal_patch_mac $(mtd_get_mac_binary art 18)
|
||||
;;
|
||||
epg5000|\
|
||||
esr1750)
|
||||
ath10kcal_extract "caldata" 20480 2116
|
||||
|
@ -679,6 +679,9 @@ ar71xx_board_detect() {
|
||||
*"DW33D")
|
||||
name="dw33d"
|
||||
;;
|
||||
*"SBR-AC1750")
|
||||
name="sbr-ac1750"
|
||||
;;
|
||||
*"E1700AC v2")
|
||||
name="e1700ac-v2"
|
||||
;;
|
||||
|
@ -351,6 +351,7 @@ platform_check_image() {
|
||||
db120|\
|
||||
dr344|\
|
||||
dw33d|\
|
||||
sbr-ac1750|\
|
||||
f9k1115v2|\
|
||||
hornet-ub|\
|
||||
mr12|\
|
||||
|
@ -96,6 +96,7 @@ CONFIG_ATH79=y
|
||||
# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set
|
||||
# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set
|
||||
# CONFIG_ATH79_MACH_DOMYWIFI_DW33D is not set
|
||||
# CONFIG_ATH79_MACH_ARRIS_SBR_AC1750 is not set
|
||||
# CONFIG_ATH79_MACH_DR342 is not set
|
||||
# CONFIG_ATH79_MACH_DR344 is not set
|
||||
# CONFIG_ATH79_MACH_DR531 is not set
|
||||
|
@ -646,6 +646,18 @@ config ATH79_MACH_DOMYWIFI_DW33D
|
||||
select ATH79_DEV_NFC
|
||||
select ATH79_DEV_WMAC
|
||||
select ATH79_DEV_USB
|
||||
|
||||
config ATH79_MACH_ARRIS_SBR_AC1750
|
||||
bool "Arris SBR-AC1750 support"
|
||||
select SOC_QCA955X
|
||||
select ATH79_DEV_AP9X_PCI if PCI
|
||||
select ATH79_DEV_ETH
|
||||
select ATH79_DEV_GPIO_BUTTONS
|
||||
select ATH79_DEV_LEDS_GPIO
|
||||
select ATH79_DEV_M25P80
|
||||
select ATH79_DEV_NFC
|
||||
select ATH79_DEV_WMAC
|
||||
select ATH79_DEV_USB
|
||||
|
||||
config ATH79_MACH_DR342
|
||||
bool "Wallys DR342 board support"
|
||||
|
@ -107,6 +107,7 @@ obj-$(CONFIG_ATH79_MACH_DLAN_HOTSPOT) += mach-dlan-hotspot.o
|
||||
obj-$(CONFIG_ATH79_MACH_DLAN_PRO_1200_AC) += mach-dlan-pro-1200-ac.o
|
||||
obj-$(CONFIG_ATH79_MACH_DLAN_PRO_500_WP) += mach-dlan-pro-500-wp.o
|
||||
obj-$(CONFIG_ATH79_MACH_DOMYWIFI_DW33D) += mach-domywifi-dw33d.o
|
||||
obj-$(CONFIG_ATH79_MACH_ARRIS_SBR_AC1750) += mach-sbr-ac1750.o
|
||||
obj-$(CONFIG_ATH79_MACH_DR342) += mach-dr344.o
|
||||
obj-$(CONFIG_ATH79_MACH_DR344) += mach-dr344.o
|
||||
obj-$(CONFIG_ATH79_MACH_DR531) += mach-dr531.o
|
||||
|
247
target/linux/ar71xx/files/arch/mips/ath79/mach-sbr-ac1750.c
Normal file
247
target/linux/ar71xx/files/arch/mips/ath79/mach-sbr-ac1750.c
Normal file
@ -0,0 +1,247 @@
|
||||
/*
|
||||
* Arris sbr-ac1750 support
|
||||
*
|
||||
* Copyright (c) 2012 Qualcomm Atheros
|
||||
* Copyright (c) 2012-2013 Gabor Juhos <juhosg@openwrt.org>
|
||||
* Copyright (c) 2019 Mleaf <mleaf90@gmail.com>
|
||||
*
|
||||
* 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/version.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/ar8216_platform.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,14,0)
|
||||
#include <linux/mtd/nand.h>
|
||||
#else
|
||||
#include <linux/mtd/rawnand.h>
|
||||
#endif
|
||||
#include <linux/platform/ar934x_nfc.h>
|
||||
|
||||
#include <asm/mach-ath79/ar71xx_regs.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include "common.h"
|
||||
#include "pci.h"
|
||||
#include "dev-ap9x-pci.h"
|
||||
#include "dev-gpio-buttons.h"
|
||||
#include "dev-eth.h"
|
||||
#include "dev-leds-gpio.h"
|
||||
#include "dev-m25p80.h"
|
||||
#include "dev-nfc.h"
|
||||
#include "dev-usb.h"
|
||||
#include "dev-wmac.h"
|
||||
#include "machtypes.h"
|
||||
|
||||
#define SBR_AC1750_GPIO_LED_WLAN_2G 2
|
||||
#define SBR_AC1750_GPIO_LED_WLAN_5G 21
|
||||
#define SBR_AC1750_GPIO_LED_WPS 23
|
||||
#define SBR_AC1750_GPIO_LED_USB 22
|
||||
|
||||
#define SBR_AC1750_GPIO_BTN_RESET 17
|
||||
#define SBR_AC1750_GPIO_BTN_WPS 19
|
||||
|
||||
#define SBR_AC1750_KEYS_POLL_INTERVAL 20 /* msecs */
|
||||
#define SBR_AC1750_KEYS_DEBOUNCE_INTERVAL (3 * SBR_AC1750_KEYS_POLL_INTERVAL)
|
||||
|
||||
#define SBR_AC1750_MAC0_OFFSET 0
|
||||
#define SBR_AC1750_MAC1_OFFSET 6
|
||||
#define SBR_AC1750_WMAC_OFFSET 12
|
||||
#define SBR_AC1750_WMAC_CALDATA_OFFSET 0x1000
|
||||
#define SBR_AC1750_PCIE_CALDATA_OFFSET 0x5000
|
||||
|
||||
#define SBR_AC1750_EXT_WDT_TIMEOUT_MS 200
|
||||
#define SBR_AC1750_GPIO_EXT_WDT 18
|
||||
#define SBR_AC1750_HANG_UP 9
|
||||
|
||||
static struct timer_list gpio_wdt_timer;
|
||||
|
||||
static struct gpio_led sbr_ac1750_leds_gpio[] __initdata = {
|
||||
{
|
||||
.name = "sbr-ac1750:blue:wlan-2g",
|
||||
.gpio = SBR_AC1750_GPIO_LED_WLAN_2G,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "sbr-ac1750:blue:wlan-5g",
|
||||
.gpio = SBR_AC1750_GPIO_LED_WLAN_5G,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "sbr-ac1750:blue:wps",
|
||||
.gpio = SBR_AC1750_GPIO_LED_WPS,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "sbr-ac1750:blue:usb",
|
||||
.gpio = SBR_AC1750_GPIO_LED_USB,
|
||||
.active_low = 1,
|
||||
}
|
||||
};
|
||||
|
||||
static struct gpio_keys_button sbr_ac1750_gpio_keys[] __initdata = {
|
||||
{
|
||||
.desc = "WPS button",
|
||||
.type = EV_KEY,
|
||||
.code = KEY_WPS_BUTTON,
|
||||
.debounce_interval = SBR_AC1750_KEYS_DEBOUNCE_INTERVAL,
|
||||
.gpio = SBR_AC1750_GPIO_BTN_WPS,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.desc = "Reset button",
|
||||
.type = EV_KEY,
|
||||
.code = KEY_RESTART,
|
||||
.debounce_interval = SBR_AC1750_KEYS_DEBOUNCE_INTERVAL,
|
||||
.gpio = SBR_AC1750_GPIO_BTN_RESET,
|
||||
.active_low = 1,
|
||||
}
|
||||
};
|
||||
|
||||
/* GMAC6 of the QCA8337 switch is connected to the QCA9558 SoC via SGMII */
|
||||
static struct ar8327_pad_cfg sbr_ac1750_qca8337_pad6_cfg = {
|
||||
.mode = AR8327_PAD_MAC_SGMII,
|
||||
.sgmii_delay_en = true,
|
||||
.rxclk_delay_sel = AR8327_CLK_DELAY_SEL0,
|
||||
};
|
||||
|
||||
/* GMAC0 of the QCA8337 switch is connected to the QCA9558 SoC via RGMII */
|
||||
static struct ar8327_pad_cfg sbr_ac1750_qca8337_pad0_cfg = {
|
||||
.mode = AR8327_PAD_MAC_RGMII,
|
||||
.txclk_delay_en = true,
|
||||
.rxclk_delay_en = true,
|
||||
.txclk_delay_sel = AR8327_CLK_DELAY_SEL1,
|
||||
.rxclk_delay_sel = AR8327_CLK_DELAY_SEL2,
|
||||
};
|
||||
|
||||
static struct ar8327_led_cfg sbr_ac1750_ar8327_led_cfg = {
|
||||
.led_ctrl0 = 0xcc35cc35,
|
||||
.led_ctrl1 = 0xca35ca35,
|
||||
.led_ctrl2 = 0xc935c935,
|
||||
.led_ctrl3 = 0x3ffff00,
|
||||
.open_drain = true,
|
||||
};
|
||||
|
||||
static struct ar8327_platform_data sbr_ac1750_qca8337_data = {
|
||||
.pad0_cfg = &sbr_ac1750_qca8337_pad0_cfg,
|
||||
.pad6_cfg = &sbr_ac1750_qca8337_pad6_cfg,
|
||||
.port0_cfg = {
|
||||
.force_link = 1,
|
||||
.speed = AR8327_PORT_SPEED_1000,
|
||||
.duplex = 1,
|
||||
.txpause = 1,
|
||||
.rxpause = 1,
|
||||
},
|
||||
.port6_cfg = {
|
||||
.force_link = 1,
|
||||
.speed = AR8327_PORT_SPEED_1000,
|
||||
.duplex = 1,
|
||||
.txpause = 1,
|
||||
.rxpause = 1,
|
||||
},
|
||||
.led_cfg = &sbr_ac1750_ar8327_led_cfg,
|
||||
};
|
||||
|
||||
static struct mdio_board_info sbr_ac1750_mdio0_info[] = {
|
||||
{
|
||||
.bus_id = "ag71xx-mdio.0",
|
||||
.mdio_addr = 0,
|
||||
.platform_data = &sbr_ac1750_qca8337_data,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
* SBR_AC1750 devices include external hardware watchdog chip,
|
||||
* watchdog chip connected to a selected GPIO
|
||||
* and WiSoC RESET_L input. Watchdog time-out is ~1.6 s.
|
||||
*/
|
||||
static void gpio_wdt_toggle(unsigned long gpio)
|
||||
{
|
||||
static int state;
|
||||
|
||||
state = !state;
|
||||
gpio_set_value(gpio, state);
|
||||
|
||||
mod_timer(&gpio_wdt_timer,
|
||||
jiffies + msecs_to_jiffies(SBR_AC1750_EXT_WDT_TIMEOUT_MS));
|
||||
}
|
||||
|
||||
static void __init_watchdog(int gpio_wdt){
|
||||
|
||||
if (gpio_wdt >= 0) {
|
||||
gpio_request_one(gpio_wdt, GPIOF_OUT_INIT_HIGH, "watchdog");
|
||||
setup_timer(&gpio_wdt_timer, gpio_wdt_toggle, gpio_wdt);
|
||||
gpio_wdt_toggle(gpio_wdt);
|
||||
}
|
||||
}
|
||||
|
||||
static void exit_watchdog(void){
|
||||
|
||||
gpio_request_one(SBR_AC1750_GPIO_EXT_WDT, GPIOF_OUT_INIT_HIGH, "WATCHDOG EXIT");
|
||||
gpio_set_value(SBR_AC1750_GPIO_EXT_WDT, 0);
|
||||
ndelay(1000);
|
||||
gpio_set_value(SBR_AC1750_GPIO_EXT_WDT, 1);
|
||||
}
|
||||
|
||||
static void __init sbr_ac1750_setup(void)
|
||||
{
|
||||
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
|
||||
exit_watchdog();
|
||||
__init_watchdog(SBR_AC1750_GPIO_EXT_WDT);
|
||||
|
||||
ath79_register_leds_gpio(-1, ARRAY_SIZE(sbr_ac1750_leds_gpio),
|
||||
sbr_ac1750_leds_gpio);
|
||||
ath79_register_gpio_keys_polled(-1, SBR_AC1750_KEYS_POLL_INTERVAL,
|
||||
ARRAY_SIZE(sbr_ac1750_gpio_keys),
|
||||
sbr_ac1750_gpio_keys);
|
||||
|
||||
ath79_register_usb();
|
||||
ath79_nfc_set_ecc_mode(AR934X_NFC_ECC_HW);
|
||||
ath79_register_nfc();
|
||||
|
||||
ath79_register_pci();
|
||||
ath79_register_wmac_simple();
|
||||
|
||||
ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN);
|
||||
|
||||
ath79_register_mdio(0, 0x0);
|
||||
|
||||
ath79_init_mac(ath79_eth0_data.mac_addr, art + SBR_AC1750_MAC0_OFFSET, 0);
|
||||
ath79_init_mac(ath79_eth1_data.mac_addr, art + SBR_AC1750_MAC1_OFFSET, 0);
|
||||
|
||||
mdiobus_register_board_info(sbr_ac1750_mdio0_info,
|
||||
ARRAY_SIZE(sbr_ac1750_mdio0_info));
|
||||
|
||||
/* GMAC0 is connected to the RMGII interface */
|
||||
ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
|
||||
ath79_eth0_data.phy_mask = BIT(0);
|
||||
ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev;
|
||||
ath79_eth0_pll_data.pll_1000 = 0x56000000;
|
||||
|
||||
ath79_register_eth(0);
|
||||
|
||||
/* GMAC1 is connected tot eh SGMII interface */
|
||||
ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII;
|
||||
ath79_eth1_data.speed = SPEED_1000;
|
||||
ath79_eth1_data.duplex = DUPLEX_FULL;
|
||||
ath79_eth1_pll_data.pll_1000 = 0x03000101;
|
||||
|
||||
ath79_register_eth(1);
|
||||
}
|
||||
|
||||
MIPS_MACHINE(ATH79_MACH_ARRIS_SBR_AC1750, "SBR-AC1750",
|
||||
"ARRIS SBR-AC1750",
|
||||
sbr_ac1750_setup);
|
@ -101,6 +101,7 @@ enum ath79_mach_type {
|
||||
ATH79_MACH_DLAN_PRO_1200_AC, /* devolo dLAN pro 1200+ WiFi ac*/
|
||||
ATH79_MACH_DLAN_PRO_500_WP, /* devolo dLAN pro 500 Wireless+ */
|
||||
ATH79_MACH_DOMYWIFI_DW33D, /* DomyWifi DW33D */
|
||||
ATH79_MACH_ARRIS_SBR_AC1750, /* ARRIS SBR-AC1750 */
|
||||
ATH79_MACH_DR342, /* Wallys DR342 */
|
||||
ATH79_MACH_DR344, /* Wallys DR344 */
|
||||
ATH79_MACH_DR531, /* Wallys DR531 */
|
||||
|
@ -39,6 +39,26 @@ define Device/domywifi-dw33d
|
||||
endef
|
||||
TARGET_DEVICES += domywifi-dw33d
|
||||
|
||||
define Device/sbr-ac1750
|
||||
DEVICE_TITLE := Arris sbr-ac1750
|
||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x
|
||||
BOARDNAME := SBR-AC1750
|
||||
IMAGE_SIZE := 105m
|
||||
KERNEL_SIZE := 2048k
|
||||
# MTDPARTS := ar934x-nfc:1m(u-boot)ro,1m(u-boot-env)ro,2m(kernel),16m(rootfs),1m@0x6d00000(art)ro,18m@0x200000(firmware)
|
||||
# IMAGE/sysupgrade.bin := append-kernel | pad-to 2048k | append-rootfs | check-size $$$$(IMAGE_SIZE)
|
||||
BLOCKSIZE := 128k
|
||||
PAGESIZE := 2048
|
||||
UBINIZE_OPTS := -E 5
|
||||
CONSOLE := ttyS0,115200
|
||||
MTDPARTS := ar934x-nfc:1m(u-boot)ro,1m(u-boot-env)ro,2m(kernel),105m(ubi),1m@0x6d00000(art)ro
|
||||
IMAGES := sysupgrade.tar factory.bin
|
||||
KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma
|
||||
IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | check-size $$$$(IMAGE_SIZE)
|
||||
IMAGE/sysupgrade.tar := sysupgrade-tar
|
||||
endef
|
||||
TARGET_DEVICES += sbr-ac1750
|
||||
|
||||
define Device/hiveap-121
|
||||
DEVICE_TITLE := Aerohive HiveAP-121
|
||||
DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-i2c-gpio-custom kmod-spi-gpio kmod-ath9k kmod-tpm-i2c-atmel
|
||||
|
@ -9,6 +9,7 @@ CONFIG_ATH79_DEV_USB=y
|
||||
CONFIG_ATH79_DEV_WMAC=y
|
||||
CONFIG_ATH79_MACH_C60=y
|
||||
CONFIG_ATH79_MACH_DOMYWIFI_DW33D=y
|
||||
CONFIG_ATH79_MACH_ARRIS_SBR_AC1750=y
|
||||
CONFIG_ATH79_MACH_HIVEAP_121=y
|
||||
CONFIG_ATH79_MACH_MR18=y
|
||||
CONFIG_ATH79_MACH_NBG6716=y
|
||||
|
@ -1,5 +1,5 @@
|
||||
BOARDNAME := Generic devices with NAND flash
|
||||
FEATURES += squashfs nand rtc small_flash
|
||||
FEATURES += squashfs nand rtc small_flash ubifs
|
||||
|
||||
define Target/Description
|
||||
Build firmware images for Atheros AR71xx/AR913x based boards with
|
||||
|
Loading…
Reference in New Issue
Block a user